public class NativeKeyPairGeneratorSpi extends KeyPairGenerator
| Constructor and Description |
|---|
NativeKeyPairGeneratorSpi(int nativeAlgorithmId,
String algorithm) |
| Modifier and Type | Method and Description |
|---|---|
KeyPair |
generateKeyPair()
Generates a key pair.
|
void |
initialize(AlgorithmParameterSpec params,
SecureRandom random)
Initializes the key pair generator with the given parameter set and source of randomness.
|
void |
initialize(int keysize,
SecureRandom random)
Initializes the key pair generator for a certain keysize with the given source of randomness (and a default
parameter set).
|
static int |
nativeGetAlgorithm(byte[] algorithm)
Get the supported algorithm native ID.
|
genKeyPair, getInstance, initialize, initializepublic NativeKeyPairGeneratorSpi(int nativeAlgorithmId,
String algorithm)
nativeAlgorithmId - algorithm - public KeyPair generateKeyPair()
KeyPairGeneratorIf this KeyPairGenerator has not been initialized explicitly, provider-specific defaults will be used for the size and other (algorithm-specific) values of the generated keys.
This will generate a new key pair every time it is called.
This method is functionally equivalent to genKeyPair.
generateKeyPair in class KeyPairGeneratorpublic void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
KeyPairGenerator
This concrete method has been added to this previously-defined abstract class. This method calls the
KeyPairGeneratorSpi
initialize method, passing it params and random. That initialize method always throws an
UnsupportedOperationException if it is not overridden by the provider.
initialize in class KeyPairGeneratorparams - the parameter set used to generate the keys.random - the source of randomness.InvalidAlgorithmParameterException - if the given parameters are inappropriate for this key pair generator.public void initialize(int keysize,
SecureRandom random)
KeyPairGeneratorinitialize in class KeyPairGeneratorkeysize - the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of
bits.random - the source of randomness.public static int nativeGetAlgorithm(byte[] algorithm)
algorithm - Null terminated string that describes the algorithm