Skip to content

Instantly share code, notes, and snippets.

@lenards
Created August 17, 2010 20:45
Show Gist options
  • Select an option

  • Save lenards/531926 to your computer and use it in GitHub Desktop.

Select an option

Save lenards/531926 to your computer and use it in GitHub Desktop.
// ... snippet
/**
* Generates the keystore file according to the in-memory specification for
* this class.
*
* @throws RuntimeException if the keystore file can't be generated.
*/
public void generateKeystoreFile()
{
try
{
KeyStore keystore = KeyStore.getInstance(type);
keystore.load(null);
generateKeys(keystore);
keystore.store(new FileOutputStream(path), password.toCharArray());
}
catch(GeneralSecurityException e)
{
throw new RuntimeException(e);
}
catch(IOException e)
{
throw new RuntimeException(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment