Package net.i2p.crypto.eddsa
Class KeyPairGenerator
java.lang.Object
java.security.KeyPairGeneratorSpi
net.i2p.crypto.eddsa.KeyPairGenerator
- Direct Known Subclasses:
RedKeyPairGenerator
Default keysize is 256 (Ed25519)
- Since:
- 0.9.15
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected EdDSAParameterSpec
protected boolean
protected SecureRandom
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected EdDSANamedCurveSpec
createNamedCurveSpec
(String curveName) Create an EdDSANamedCurveSpec from the provided curve name.void
initialize
(int keysize, SecureRandom random) void
initialize
(AlgorithmParameterSpec params, SecureRandom random)
-
Field Details
-
DEFAULT_KEYSIZE
protected static final int DEFAULT_KEYSIZE- See Also:
-
edParams
-
random
-
initialized
protected boolean initialized
-
-
Constructor Details
-
KeyPairGenerator
public KeyPairGenerator()
-
-
Method Details
-
initialize
- Specified by:
initialize
in classKeyPairGeneratorSpi
-
initialize
public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException - Overrides:
initialize
in classKeyPairGeneratorSpi
- Throws:
InvalidAlgorithmParameterException
-
generateKeyPair
- Specified by:
generateKeyPair
in classKeyPairGeneratorSpi
-
createNamedCurveSpec
protected EdDSANamedCurveSpec createNamedCurveSpec(String curveName) throws InvalidAlgorithmParameterException Create an EdDSANamedCurveSpec from the provided curve name. The current implementation fetches the pre-created curve spec from a table.- Parameters:
curveName
- the EdDSA named curve.- Returns:
- the specification for the named curve.
- Throws:
InvalidAlgorithmParameterException
- if the named curve is unknown.
-