Top Description Fields Constructors Methods
org.bouncycastle.crypto.asymmetric

public final Class AsymmetricECPrivateKey

extends AsymmetricECKey
implements Destroyable, AsymmetricPrivateKey
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AsymmetricPrivateKey, org.bouncycastle.crypto.AsymmetricKey, org.bouncycastle.crypto.Key, javax.security.auth.Destroyable
Imports
java.io.IOException, java.math.BigInteger, java.util.concurrent.atomic.AtomicBoolean, javax.security.auth.Destroyable, org.bouncycastle.asn1.DERBitString, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.sec.ECPrivateKey, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.asn1.x9.X962Parameters, .X9ObjectIdentifiers, org.bouncycastle.crypto.Algorithm, .AsymmetricPrivateKey, org.bouncycastle.crypto.internal.Permissions, org.bouncycastle.math.ec.ECPoint, org.bouncycastle.util.Arrays

Class for Elliptic Curve (EC) private keys.

Field Summary

Modifier and TypeField and Description
private BigInteger
d

private final AtomicBoolean
private int
private final byte[]
Inherited from org.bouncycastle.crypto.asymmetric.AsymmetricECKey:
algorithmdomainParameters

Constructor Summary

AccessConstructor and Description
public
public
public
public
public
AsymmetricECPrivateKey(Algorithm ecAlg, byte[] encoding)

public
private
AsymmetricECPrivateKey(Algorithm ecAlg, AlgorithmIdentifier algorithmIdentifier, ECPrivateKey privateKey)

Method Summary

Modifier and TypeMethod and Description
private int
public void
destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Destroy this Object.
public boolean
equals(Object
object to compare to.
o
)

Overrides java.lang.Object.equals.

Implements org.bouncycastle.crypto.Key.equals.

Return true if o is an equivalent key to this.
private byte[]
public final Algorithm

Returns:

the key's algorithm.
getAlgorithm
()

Overrides org.bouncycastle.crypto.asymmetric.AsymmetricECKey.getAlgorithm.

Implements org.bouncycastle.crypto.Key.getAlgorithm.

Return the algorithm this Elliptic Curve key is for.
public final ECDomainParameters

Returns:

the EC domain parameters for the key.
getDomainParameters
()

Overrides org.bouncycastle.crypto.asymmetric.AsymmetricECKey.getDomainParameters.

Return the Elliptic Curve domain parameters associated with this key.
public final byte[]
getEncoded()

Implements org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
public BigInteger
getS()

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements org.bouncycastle.crypto.Key.hashCode.

Return the hashCode for the key.
public boolean
isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.
private static ECPrivateKey
Inherited from org.bouncycastle.crypto.asymmetric.AsymmetricECKey:
checkApprovedOnlyModeStatuszeroize

Field Detail

dback to summary
private BigInteger d
hasBeenDestroyedback to summary
private final AtomicBoolean hasBeenDestroyed
hashCodeback to summary
private int hashCode
publicKeyback to summary
private final byte[] publicKey

Constructor Detail

AsymmetricECPrivateKeyback to summary
public AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParametersID domainParametersID, BigInteger s)
AsymmetricECPrivateKeyback to summary
public AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParameters domainParameters, BigInteger s)
AsymmetricECPrivateKeyback to summary
public AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParameters domainParameters, BigInteger s, ECPoint w)
AsymmetricECPrivateKeyback to summary
public AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParametersID domainParametersID, BigInteger s, ECPoint w)
AsymmetricECPrivateKeyback to summary
public AsymmetricECPrivateKey(Algorithm ecAlg, byte[] encoding)
AsymmetricECPrivateKeyback to summary
public AsymmetricECPrivateKey(Algorithm ecAlg, PrivateKeyInfo privateKeyInfo)
AsymmetricECPrivateKeyback to summary
private AsymmetricECPrivateKey(Algorithm ecAlg, AlgorithmIdentifier algorithmIdentifier, ECPrivateKey privateKey)

Method Detail

calculateHashCodeback to summary
private int calculateHashCode()
destroyback to summary
public void destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Doc from javax.security.auth.Destroyable.destroy.

Destroy this Object.

Sensitive information associated with this Object is destroyed or cleared. Subsequent calls to certain methods on this Object will result in an IllegalStateException being thrown.

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements org.bouncycastle.crypto.Key.equals.

Doc from org.bouncycastle.crypto.Key.equals.

Return true if o is an equivalent key to this.

Parameters
o:Object

object to compare to.

Returns:boolean

true if o is the same or equivalent key, false otherwise.

Annotations
@Override
extractPublicKeyBytesback to summary
private byte[] extractPublicKeyBytes(ECPoint w)
getAlgorithmback to summary
public final Algorithm getAlgorithm()

Overrides org.bouncycastle.crypto.asymmetric.AsymmetricECKey.getAlgorithm.

Implements org.bouncycastle.crypto.Key.getAlgorithm.

Return the algorithm this Elliptic Curve key is for.

Returns:Algorithm

the key's algorithm.

getDomainParametersback to summary
public final ECDomainParameters getDomainParameters()

Overrides org.bouncycastle.crypto.asymmetric.AsymmetricECKey.getDomainParameters.

Return the Elliptic Curve domain parameters associated with this key.

Returns:ECDomainParameters

the EC domain parameters for the key.

getEncodedback to summary
public final byte[] getEncoded()

Implements org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Doc from org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.

Returns:byte[]

an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.

getSback to summary
public BigInteger getS()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.bouncycastle.crypto.Key.hashCode.

Doc from org.bouncycastle.crypto.Key.hashCode.

Return the hashCode for the key.

Returns:int

the key's hashCode.

Annotations
@Override
isDestroyedback to summary
public boolean isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Doc from javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.

Returns:boolean

true if this Object has been destroyed, false otherwise.

parsePrivateKeyback to summary
private static ECPrivateKey parsePrivateKey(PrivateKeyInfo privateKeyInfo)