public class ECDSAKeyGenerator extends java.lang.Object implements KeyGenerator<ECDSAKey>
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CURVE_NAME |
static org.bouncycastle.crypto.params.ECDomainParameters |
ecParams |
protected static org.bouncycastle.jce.spec.ECNamedCurveParameterSpec |
ecSpec |
protected static java.lang.String |
KEY_ALGORITHM |
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
ECDSAKeyGenerator() |
Modifier and Type | Method and Description |
---|---|
ECDSAKey |
create() |
ECDSAKey |
create(java.math.BigInteger d)
Create key-pair from encoded private key.
|
ECDSAKey |
create(byte[] encodedPrivateKey)
Create key-pair from encoded private key.
|
ECDSAKey |
create(java.security.PrivateKey privateKey)
Create key-pair from a private key.
|
ECDSAKey |
create(java.lang.String seed) |
java.security.PrivateKey |
createPrivateKey(java.math.BigInteger d)
Create private key from d value.
|
java.security.PublicKey |
createPublicKey(java.math.BigInteger x,
java.math.BigInteger y)
Create public key from ECPoint x, y value.
|
java.security.PublicKey |
createPublicKey(byte[] compressed)
Create public key from compressed one.
|
protected java.security.PublicKey |
createPublicKey(org.bouncycastle.math.ec.ECPoint ecPoint) |
protected ECDSAKey |
generateKey(java.security.SecureRandom secureRandom) |
protected java.security.KeyPairGenerator |
getKeyPairGenerator(java.security.SecureRandom secureRandom) |
protected static final java.lang.String KEY_ALGORITHM
protected static final java.lang.String CURVE_NAME
protected static final org.bouncycastle.jce.spec.ECNamedCurveParameterSpec ecSpec
public static final org.bouncycastle.crypto.params.ECDomainParameters ecParams
protected final transient org.slf4j.Logger logger
protected ECDSAKey generateKey(java.security.SecureRandom secureRandom) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
java.security.InvalidAlgorithmParameterException
protected java.security.KeyPairGenerator getKeyPairGenerator(java.security.SecureRandom secureRandom) throws java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
java.security.InvalidAlgorithmParameterException
public ECDSAKey create() throws java.lang.Exception
create
in interface KeyGenerator<ECDSAKey>
java.lang.Exception
public ECDSAKey create(java.lang.String seed) throws java.lang.Exception
create
in interface KeyGenerator<ECDSAKey>
java.lang.Exception
public ECDSAKey create(byte[] encodedPrivateKey) throws java.lang.Exception
encodedPrivateKey
- PKCS #8 encoded private keyjava.lang.Exception
- On failure of recoverypublic ECDSAKey create(java.math.BigInteger d) throws java.lang.Exception
d
- d value of private keyjava.lang.Exception
- On failure of recoverypublic ECDSAKey create(java.security.PrivateKey privateKey) throws java.lang.Exception
privateKey
- a private keyjava.lang.Exception
- On failure of recoverypublic java.security.PrivateKey createPrivateKey(java.math.BigInteger d) throws java.lang.Exception
d
- d value of private keyjava.lang.Exception
- on failure of createpublic java.security.PublicKey createPublicKey(byte[] compressed) throws java.lang.Exception
Fp
(
X9.62 s 4.2.1).compressed
- an compressedjava.lang.Exception
- on failure of createpublic java.security.PublicKey createPublicKey(java.math.BigInteger x, java.math.BigInteger y) throws java.lang.Exception
x
- x value of public keyy
- y value of public keyjava.lang.Exception
- on failure of createprotected java.security.PublicKey createPublicKey(org.bouncycastle.math.ec.ECPoint ecPoint) throws java.lang.Exception
java.lang.Exception