Package net.i2p.crypto.eddsa
Class KeyPairGenerator
- java.lang.Object
-
- java.security.KeyPairGeneratorSpi
-
- net.i2p.crypto.eddsa.KeyPairGenerator
-
- Direct Known Subclasses:
RedKeyPairGenerator
public class KeyPairGenerator extends KeyPairGeneratorSpi
Default keysize is 256 (Ed25519)- Since:
- 0.9.15
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_KEYSIZEprotected EdDSAParameterSpecedParamsprotected booleaninitializedprotected SecureRandomrandom
-
Constructor Summary
Constructors Constructor Description KeyPairGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EdDSANamedCurveSpeccreateNamedCurveSpec(String curveName)Create an EdDSANamedCurveSpec from the provided curve name.KeyPairgenerateKeyPair()voidinitialize(int keysize, SecureRandom random)voidinitialize(AlgorithmParameterSpec params, SecureRandom random)
-
-
-
Field Detail
-
DEFAULT_KEYSIZE
protected static final int DEFAULT_KEYSIZE
- See Also:
- Constant Field Values
-
edParams
protected EdDSAParameterSpec edParams
-
random
protected SecureRandom random
-
initialized
protected boolean initialized
-
-
Method Detail
-
initialize
public void initialize(int keysize, SecureRandom random)- Specified by:
initializein classKeyPairGeneratorSpi
-
initialize
public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
- Overrides:
initializein classKeyPairGeneratorSpi- Throws:
InvalidAlgorithmParameterException
-
generateKeyPair
public KeyPair generateKeyPair()
- Specified by:
generateKeyPairin 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.
-
-