Results 1 to 1 of 1
- 05-15-2012, 11:34 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 32
- Rep Power
- 0
Creating keyring files for data encryption
Hi there,
I've been reading about data encryption in this link.
My doubt comes in the end:
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.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."); e.printStackTrace(System.err); } return key; }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
-
Creating Jar Files with functioning input files
By appleLove in forum NetBeansReplies: 1Last Post: 04-10-2011, 10:37 PM -
Creating files stopped creating...
By Dieter in forum Advanced JavaReplies: 3Last Post: 09-25-2009, 11:45 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks