public class KeyPairGenerator extends KeyPairGeneratorSpi
Generated keys are suitable for:
| Modifier and Type | Field and Description |
|---|---|
protected static int | DEFAULT_KEYSIZEDEFAULT_KEYSIZE. |
protected EdDSAParameterSpec | edParamsEdDSA parameter specification, set by initialize(). |
protected boolean | initializedWhether the generator has been initialized. |
protected SecureRandom | randomThe random number source, set by initialize(). |
| Constructor and Description |
|---|
KeyPairGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected EdDSANamedCurveSpec | createNamedCurveSpec(String curveName)Create an EdDSANamedCurveSpec from the provided curve name. |
KeyPair | generateKeyPair() |
void | initialize(AlgorithmParameterSpec params,
SecureRandom random)Initialize with the given parameter spec. |
void | initialize(int keysize,
SecureRandom random)Initialize with the given key size. |
protected static final int DEFAULT_KEYSIZE
protected EdDSAParameterSpec edParams
protected boolean initialized
protected SecureRandom random
protected EdDSANamedCurveSpec createNamedCurveSpec(String curveName) throws InvalidAlgorithmParameterException
curveName - the EdDSA named curve.InvalidAlgorithmParameterException - if the named curve is unknown.public KeyPair generateKeyPair()
generateKeyPair in class KeyPairGeneratorSpipublic void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
initialize in class KeyPairGeneratorSpiInvalidAlgorithmParameterExceptionpublic void initialize(int keysize,
SecureRandom random)initialize in class KeyPairGeneratorSpi