net.i2p.crypto.eddsa
Class KeyPairGenerator

java.lang.Object
  extended by java.security.KeyPairGeneratorSpi
      extended by net.i2p.crypto.eddsa.KeyPairGenerator

public class KeyPairGenerator
extends KeyPairGeneratorSpi

Default strength is 256

Since:
0.9.15

Constructor Summary
KeyPairGenerator()
           
 
Method Summary
protected  EdDSANamedCurveSpec createNamedCurveSpec(String curveName)
          Create an EdDSANamedCurveSpec from the provided curve name.
 KeyPair generateKeyPair()
           
 void initialize(AlgorithmParameterSpec params, SecureRandom random)
           
 void initialize(int strength, SecureRandom random)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyPairGenerator

public KeyPairGenerator()
Method Detail

initialize

public void initialize(int strength,
                       SecureRandom random)
Specified by:
initialize in class KeyPairGeneratorSpi

initialize

public void initialize(AlgorithmParameterSpec params,
                       SecureRandom random)
                throws InvalidAlgorithmParameterException
Overrides:
initialize in class KeyPairGeneratorSpi
Throws:
InvalidAlgorithmParameterException

generateKeyPair

public KeyPair generateKeyPair()
Specified by:
generateKeyPair in class KeyPairGeneratorSpi

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.