EcKeyPairGenerator
insteadpublic class ECDSAKeyPairGenerator
extends java.security.KeyPairGenerator
An ECDSAKeyPairGenerator object can be created using the class
constructor or using the KeyPairGenerator class as follows:
ECDSAKeyPairGenerator keygen = (ECDSAKeyPairGenerator) KeyPairGenerator.getInstance("ECDSA");
(ECDSAKeyPairGenerator)
the initialize methods do not work and no exceptions are thrown.| Constructor and Description |
|---|
ECDSAKeyPairGenerator()
Deprecated.
The default public constructor calls the super constructor
with the
String, "ECDSA". |
| Modifier and Type | Method and Description |
|---|---|
java.security.KeyPair |
generateKeyPair()
Deprecated.
Generates an ECDSA key pair.
|
void |
initialize(java.security.spec.AlgorithmParameterSpec params)
Deprecated.
Initializes the key pair generator using the specified parameter set.
|
void |
initialize(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Deprecated.
Initializes the key pair generator using the specified parameter set and
user-provided source of randomness.
|
void |
initialize(int keysize)
Deprecated.
Initializes the key pair generator for a certain keysize using the default
parameter set.
|
void |
initialize(int keysize,
java.security.SecureRandom random)
Deprecated.
Initializes the key pair generator for a certain keysize using the default
parameter set.
|
public ECDSAKeyPairGenerator()
String, "ECDSA".
public java.security.KeyPair generateKeyPair()
If an initialization method is called using a KeyPairGenerator
interface, algorithm-specific defaults will be used. The default curve is
labeled x962p192r1 as defined in X9.62 with object
identifier 1.2.840.10045.3.1.1.
generateKeyPair in class java.security.KeyPairGeneratorKeyPairjava.lang.IllegalArgumentException - if any of the following conditions are satisfied:
ASN1Object is not of the expected formatjava.lang.SecurityException - thrown if the FIPS Security Engine is in the FIPS error statepublic void initialize(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
throws java.security.InvalidAlgorithmParameterException
initialize in class java.security.KeyPairGeneratorparams - the parameter set used to generate the keysrandom - the source of randomness for this generator will be
ignored and the default source of randomness will be used
insteadjava.security.InvalidAlgorithmParameterException - if params is not an ECParameter object
and if the key size in params is less than 160 bitspublic void initialize(java.security.spec.AlgorithmParameterSpec params)
throws java.security.InvalidAlgorithmParameterException
initialize in class java.security.KeyPairGeneratorparams - the parameter set used to generate the keysjava.security.InvalidAlgorithmParameterException - if params is not an ECParameter object
and if the key size in params is less than 160 bitspublic void initialize(int keysize,
java.security.SecureRandom random)
throws java.security.InvalidParameterException
The default curve is taken from the set of named curves that consists of
all named curves defined in X9.62 and those registered using the
NamedCurveFactory.register method.
initialize in class java.security.KeyPairGeneratorkeysize - an algorithm-specific metric the size of the underlying
field of the curve, specified as the number of bits - the parameter
set used to generate the keys
NamedCurveFactory class.random - the source of randomness for this generator will be
ignored and the default source of randomness will be used
insteadjava.security.InvalidParameterException - if the key size is not supported and if the key size is less than
160public void initialize(int keysize)
throws java.security.InvalidParameterException
The default curve is taken from the set of named curves that consists of all
named curves defined in X9.62 and those registered using the
NamedCurveFactory.register method.
initialize in class java.security.KeyPairGeneratorkeysize - an algorithm-specific metric the size of the underlying
field of the curve, specified as the number of bits - the parameter
set used to generate the keys
NamedCurveFactory class.java.security.InvalidParameterException - if the key size is not supported and if the key size is less
than 160