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(Algorithm algorithm,
int keySize)
Factory method for creating a new
KeyPair from the given algorithm and key size. |
static KeyPair |
newKeyPair(Algorithm algorithm,
KeySize 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(Algorithm algorithm, KeySize keySize) throws NoSuchAlgorithmException
algorithm - the algorithmkeySize - the key size as enumKeyPair from the given salt and iteration count.NoSuchAlgorithmException - the no such algorithm exceptionpublic static KeyPair newKeyPair(Algorithm algorithm, int keySize) throws NoSuchAlgorithmException
KeyPair from the given algorithm and key size.algorithm - the algorithmkeySize - the key sizeKeyPair from the given salt and iteration count.NoSuchAlgorithmException - the no such algorithm exceptionpublic static KeyPair newKeyPair(String algorithm, int keySize) throws NoSuchAlgorithmException
KeyPair from the given parameters.algorithm - the algorithmkeySize - the key sizeKeyPair from the given parameters.NoSuchAlgorithmException - the no such algorithm exceptionpublic 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 instantiation of the cypher object fails.InvalidKeySpecException - is thrown if generation of the SecretKey object fails.NoSuchProviderException - is thrown if the specified provider is not registered in the security provider
list.public static KeyPairGenerator newKeyPairGenerator(String algorithm, int keySize) throws NoSuchAlgorithmException
KeyPairGenerator from the given parameters.algorithm - the algorithmkeySize - the key sizeKeyPairGenerator from the given parameters.NoSuchAlgorithmException - is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the
specified algorithm.public 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 parameters.NoSuchAlgorithmException - is thrown if no Provider supports a KeyPairGeneratorSpi implementation for the
specified algorithm.Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.