ksFile.deleteOnExit();
FileOutputStream fos = new FileOutputStream(ksFile);
HashMap attributes = new HashMap();
attributes.put(IKeyring.KEYRING_DATA_OUT, fos);
attributes.put(IKeyring.KEYRING_PASSWORD, STORE_PASSWORD);
kr1.store(attributes);
fos.flush();
fos.close();
// re-load it from the persisted file
GnuPrivateKeyring kr2 = new GnuPrivateKeyring();