public class RSAKeyPairUtils
extends java.lang.Object
Constructor and Description |
---|
RSAKeyPairUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
changePassphrase(RSAKeyPair keyPair,
java.lang.String oldPassphrase,
java.lang.String newPassphrase) |
static RSAKeyPair |
deserialize(java.lang.String encodedKeyPair) |
static RSAKeyPair |
generateRSAKeyPair(java.lang.String passphrase)
generates a new RSA keypair
and sets the passphrase on the private key if passphrase !
|
static byte[] |
getPrivateKey(RSAKeyPair keyPair,
java.lang.String passphrase) |
static byte[] |
getPublicKey(RSAKeyPair keyPair) |
static boolean |
isPassphraseCorrect(RSAKeyPair keyPair,
java.lang.String passphrase) |
static java.lang.String |
serialize(RSAKeyPair keyPair) |
public static RSAKeyPair generateRSAKeyPair(java.lang.String passphrase) throws DESEncrypter.PersistentKeyException, java.security.GeneralSecurityException, java.io.IOException
passphrase
- java.io.IOException
java.security.GeneralSecurityException
DESEncrypter.PersistentKeyException
public static void changePassphrase(RSAKeyPair keyPair, java.lang.String oldPassphrase, java.lang.String newPassphrase) throws DESEncrypter.PersistentKeyException, java.security.GeneralSecurityException, java.io.IOException, IncorrectPassphraseException
DESEncrypter.PersistentKeyException
java.security.GeneralSecurityException
java.io.IOException
IncorrectPassphraseException
public static boolean isPassphraseCorrect(RSAKeyPair keyPair, java.lang.String passphrase) throws DESEncrypter.PersistentKeyException, java.security.GeneralSecurityException, java.io.IOException
DESEncrypter.PersistentKeyException
java.security.GeneralSecurityException
java.io.IOException
public static byte[] getPrivateKey(RSAKeyPair keyPair, java.lang.String passphrase) throws DESEncrypter.PersistentKeyException, java.security.GeneralSecurityException, java.io.IOException, IncorrectPassphraseException
DESEncrypter.PersistentKeyException
java.security.GeneralSecurityException
java.io.IOException
IncorrectPassphraseException
public static byte[] getPublicKey(RSAKeyPair keyPair) throws java.io.IOException
java.io.IOException
public static java.lang.String serialize(RSAKeyPair keyPair)
public static RSAKeyPair deserialize(java.lang.String encodedKeyPair) throws java.io.IOException
java.io.IOException