public class KeyPairFactory extends Object
KeyPairFactory holds methods for creating KeyPair objects.| Constructor and Description |
|---|
KeyPairFactory() |
| Modifier and Type | Method and Description |
|---|---|
static KeyPair |
newKeyPair(de.alpharogroup.crypto.algorithm.Algorithm algorithm,
int keySize)
Factory method for creating a new
KeyPair from the given algorithm and key size. |
static KeyPair |
newKeyPair(de.alpharogroup.crypto.algorithm.Algorithm algorithm,
de.alpharogroup.crypto.key.KeySize keySize)
Factory method for creating a new
KeyPair from the given algorithm and
KeySize |
static KeyPair |
newKeyPair(File publicKeyDerFile,
File privateKeyDerFile)
Factory method for creating a new
KeyPair from the given parameters. |
static KeyPair |
newKeyPair(PublicKey publicKey,
PrivateKey privateKey)
Factory method for creating a new
KeyPair from the given parameters. |
static KeyPair |
newKeyPair(String algorithm,
int keySize)
Factory method for creating a new
KeyPair from the given parameters. |
static KeyPairGenerator |
newKeyPairGenerator(String algorithm,
int keySize)
Factory method for creating a new
KeyPairGenerator from the given parameters. |
static KeyPairGenerator |
newKeyPairGenerator(String algorithm,
int keySize,
SecureRandom secureRandom)
Factory method for creating a new
KeyPairGenerator from the given parameters. |
public static KeyPair newKeyPair(de.alpharogroup.crypto.algorithm.Algorithm algorithm, de.alpharogroup.crypto.key.KeySize keySize) throws NoSuchAlgorithmException, NoSuchProviderException
KeyPair from the given algorithm and
KeySizealgorithm - the algorithmkeySize - the key size as enumKeyPair from the given salt and iteration countNoSuchAlgorithmException - is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the
specified algorithmNoSuchProviderException - is thrown if the specified provider is not registered in the security provider
listpublic static KeyPair newKeyPair(de.alpharogroup.crypto.algorithm.Algorithm algorithm, int keySize) throws NoSuchAlgorithmException, NoSuchProviderException
KeyPair from the given algorithm and key size.algorithm - the algorithmkeySize - the key sizeKeyPair from the given salt and iteration countNoSuchAlgorithmException - is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the
specified algorithmNoSuchProviderException - is thrown if the specified provider is not registered in the security provider
listpublic static KeyPair newKeyPair(String algorithm, int keySize) throws NoSuchAlgorithmException, NoSuchProviderException
KeyPair from the given parameters.algorithm - the algorithmkeySize - the key sizeKeyPair from the given parametersNoSuchAlgorithmException - is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the
specified algorithmNoSuchProviderException - is thrown if the specified provider is not registered in the security provider
listpublic static KeyPair newKeyPair(PublicKey publicKey, PrivateKey privateKey)
KeyPair from the given parameters.publicKey - the public keyprivateKey - the private keyKeyPair from the given parameters.public static KeyPair newKeyPair(File publicKeyDerFile, File privateKeyDerFile) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException, IOException
KeyPair from the given parameters.publicKeyDerFile - the public key der fileprivateKeyDerFile - the private key der fileKeyPair from the given parameters.IOException - Signals that an I/O exception has occurred.NoSuchAlgorithmException - is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the
specified algorithmInvalidKeySpecException - is thrown if generation of the SecretKey object fails.NoSuchProviderException - is thrown if the specified provider is not registered in the security provider
listpublic static KeyPairGenerator newKeyPairGenerator(String algorithm, int keySize) throws NoSuchAlgorithmException, NoSuchProviderException
KeyPairGenerator from the given parameters.algorithm - the algorithmkeySize - the key sizeKeyPairGenerator from the given parametersNoSuchAlgorithmException - is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the
specified algorithmNoSuchProviderException - is thrown if the specified provider is not registered in the security provider
listpublic static KeyPairGenerator newKeyPairGenerator(String algorithm, int keySize, SecureRandom secureRandom) throws NoSuchAlgorithmException
KeyPairGenerator from the given parameters.algorithm - the algorithmkeySize - the key sizesecureRandom - the secure randomKeyPairGenerator from the given parametersNoSuchAlgorithmException - is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the
specified algorithmCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.