public interface RSAKeyPairGeneratorInterface
RSAKeyPairGenerator.| Modifier and Type | Interface and Description |
|---|---|
static class |
RSAKeyPairGeneratorInterface.GeneratedClassDescriptor |
| Modifier and Type | Method and Description |
|---|---|
KeyPair |
generateKeyPair()
Generates a key pair with RSA 2048-bit security.
|
void |
saveKeyPairToFiles(KeyPair keyPair,
String privateOutputFileName,
String publicOutputFileName,
char[] password)
Saves the key pair specified to output files specified, encrypting both with the specified password.
|
void |
saveKeyPairToFiles(KeyPair keyPair,
String privateOutputFileName,
String publicOutputFileName,
char[] privatePassword,
char[] publicPassword)
Saves the key pair specified to output files specified, encrypting each with their specified passwords.
|
void |
saveKeyPairToProviders(KeyPair keyPair,
RSAKeyPairGeneratorInterface.GeneratedClassDescriptor privateKeyProvider,
RSAKeyPairGeneratorInterface.GeneratedClassDescriptor publicKeyProvider,
char[] password)
Saves the public and private keys specified to the respective
javaFileContents fields in
the provided RSAKeyPairGeneratorInterface.GeneratedClassDescriptors, encrypting both with the specified password. |
void |
saveKeyPairToProviders(KeyPair keyPair,
RSAKeyPairGeneratorInterface.GeneratedClassDescriptor privateKeyProvider,
RSAKeyPairGeneratorInterface.GeneratedClassDescriptor publicKeyProvider,
char[] privatePassword,
char[] publicPassword)
Saves the public and private keys specified to the respective
javaFileContents fields in
the provided RSAKeyPairGeneratorInterface.GeneratedClassDescriptors, encrypting each with their respective passwords. |
void |
savePasswordToProvider(char[] password,
RSAKeyPairGeneratorInterface.GeneratedClassDescriptor passwordProvider)
Saves the password specified to the
javaFileContents field in
the provided RSAKeyPairGeneratorInterface.GeneratedClassDescriptor. |
KeyPair generateKeyPair() throws RSA2048NotSupportedException
RSA2048NotSupportedException - if RSA or 2048-bit encryption are not supported.void saveKeyPairToFiles(KeyPair keyPair, String privateOutputFileName, String publicOutputFileName, char[] password) throws IOException, AlgorithmNotSupportedException, InappropriateKeyException, InappropriateKeySpecificationException
keyPair - The key pair to save to the files specifiedprivateOutputFileName - The name of the file to save the encrypted private key topublicOutputFileName - The name of the file to save the encrypted public key topassword - The password to encrypt both keys withIOException - if an error occurs while writing to the files.AlgorithmNotSupportedException - If the encryption algorithm is not supportedInappropriateKeyException - If the public or private keys are invalidInappropriateKeySpecificationException - If the public or private keys are invalidvoid saveKeyPairToFiles(KeyPair keyPair, String privateOutputFileName, String publicOutputFileName, char[] privatePassword, char[] publicPassword) throws IOException, AlgorithmNotSupportedException, InappropriateKeyException, InappropriateKeySpecificationException
keyPair - The key pair to save to the files specifiedprivateOutputFileName - The name of the file to save the encrypted private key topublicOutputFileName - The name of the file to save the encrypted public key toprivatePassword - The password to encrypt the private key withpublicPassword - The password to encrypt the public key withIOException - if an error occurs while writing to the files.AlgorithmNotSupportedException - If the encryption algorithm is not supportedInappropriateKeyException - If the public or private keys are invalidInappropriateKeySpecificationException - If the public or private keys are invalidvoid saveKeyPairToProviders(KeyPair keyPair, RSAKeyPairGeneratorInterface.GeneratedClassDescriptor privateKeyProvider, RSAKeyPairGeneratorInterface.GeneratedClassDescriptor publicKeyProvider, char[] password) throws AlgorithmNotSupportedException, InappropriateKeyException, InappropriateKeySpecificationException
javaFileContents fields in
the provided RSAKeyPairGeneratorInterface.GeneratedClassDescriptors, encrypting both with the specified password.keyPair - The key pair to saveprivateKeyProvider - An object describing the PrivateKeyDataProvider class to generate, and into which the generated code will be savedpublicKeyProvider - An object describing the PublicKeyDataProvider class to generate, and into which the generated code will be savedpassword - The password to encrypt the keys withAlgorithmNotSupportedException - If the encryption algorithm is not supportedInappropriateKeyException - If the public or private keys are invalidInappropriateKeySpecificationException - If the public or private keys are invalidvoid saveKeyPairToProviders(KeyPair keyPair, RSAKeyPairGeneratorInterface.GeneratedClassDescriptor privateKeyProvider, RSAKeyPairGeneratorInterface.GeneratedClassDescriptor publicKeyProvider, char[] privatePassword, char[] publicPassword) throws AlgorithmNotSupportedException, InappropriateKeyException, InappropriateKeySpecificationException
javaFileContents fields in
the provided RSAKeyPairGeneratorInterface.GeneratedClassDescriptors, encrypting each with their respective passwords.keyPair - The key pair to saveprivateKeyProvider - An object describing the PrivateKeyDataProvider class to generate, and into which the generated code will be savedpublicKeyProvider - An object describing the PublicKeyDataProvider class to generate, and into which the generated code will be savedprivatePassword - The password to encrypt the private key withpublicPassword - The password to encrypt the public key withAlgorithmNotSupportedException - If the encryption algorithm is not supportedInappropriateKeyException - If the public or private keys are invalidInappropriateKeySpecificationException - If the public or private keys are invalidvoid savePasswordToProvider(char[] password,
RSAKeyPairGeneratorInterface.GeneratedClassDescriptor passwordProvider)
javaFileContents field in
the provided RSAKeyPairGeneratorInterface.GeneratedClassDescriptor.password - The password to save to the specified Java classpasswordProvider - An object describing the PasswordProvider class to generate, and into which the generated code will be savedCopyright © 2010-2013 NWTS Java Code. All Rights Reserved. Licensed Under the Apache License version 2.0.