Results 1 to 1 of 1
  1. #1
    Stoyicker is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Creating keyring files for data encryption

    Hi there,

    I've been reading about data encryption in this link.
    My doubt comes in the end:

    Java Code:
    protected SecretKey lookupSecretKey(String id) {
        SecretKey key = null;
        // Get the key-ring file name from the property list for this agent
        String keyringFile = System.getProperty("keyring", "keyring.dat"); //IN THIS LINE
        // Try reading the key-ring and looking up the key for the id
        try {
            // Read the key-ring from disk
            ObjectInputStream in =
                new ObjectInputStream(new FileInputStream(keyringFile));
            Hashtable keyring = (Hashtable) in.readObject();
            // Lookup the id's key on the ring
            key = (SecretKey)keyring.get(id);
        catch (Exception e) {
            System.err.println("Failure looking up key on keyring.");
        return key;
    In the referred line, how am I supposed to generate a keyring? I've been 'googling' about the topic, but I can find nothing more that some IBM links that speak about some kind of software (owned by them, of course), that uses this kind of files.
    Last edited by Stoyicker; 05-16-2012 at 04:13 PM. Reason: Now, with more time, I've been able to read the whole chapter, and the solution is in there.

Similar Threads

  1. Creating Jar Files with functioning input files
    By appleLove in forum NetBeans
    Replies: 1
    Last Post: 04-10-2011, 10:37 PM
  2. Creating files stopped creating...
    By Dieter in forum Advanced Java
    Replies: 3
    Last Post: 09-25-2009, 11:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts