Class AsymmetricECPrivateKey
- java.lang.Object
-
- org.bouncycastle.crypto.asymmetric.AsymmetricECKey
-
- org.bouncycastle.crypto.asymmetric.AsymmetricECPrivateKey
-
- All Implemented Interfaces:
javax.security.auth.Destroyable,AsymmetricKey,AsymmetricPrivateKey,Key
public final class AsymmetricECPrivateKey extends AsymmetricECKey implements javax.security.auth.Destroyable, AsymmetricPrivateKey
Class for Elliptic Curve (EC) private keys.
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricECKey
algorithm, domainParameters
-
-
Constructor Summary
Constructors Constructor Description AsymmetricECPrivateKey(Algorithm ecAlg, byte[] encoding)AsymmetricECPrivateKey(Algorithm ecAlg, PrivateKeyInfo privateKeyInfo)AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParametersID domainParametersID, java.math.BigInteger s)AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParametersID domainParametersID, java.math.BigInteger s, ECPoint w)AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParameters domainParameters, java.math.BigInteger s)AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParameters domainParameters, java.math.BigInteger s, ECPoint w)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()booleanequals(java.lang.Object o)Return true if o is an equivalent key to this.AlgorithmgetAlgorithm()Return the algorithm this Elliptic Curve key is for.ECDomainParametersgetDomainParameters()Return the Elliptic Curve domain parameters associated with this key.byte[]getEncoded()Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.java.math.BigIntegergetS()inthashCode()Return the hashCode for the key.booleanisDestroyed()-
Methods inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricECKey
checkApprovedOnlyModeStatus, zeroize
-
-
-
-
Constructor Detail
-
AsymmetricECPrivateKey
public AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParametersID domainParametersID, java.math.BigInteger s)
-
AsymmetricECPrivateKey
public AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParameters domainParameters, java.math.BigInteger s)
-
AsymmetricECPrivateKey
public AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParameters domainParameters, java.math.BigInteger s, ECPoint w)
-
AsymmetricECPrivateKey
public AsymmetricECPrivateKey(Algorithm ecAlg, ECDomainParametersID domainParametersID, java.math.BigInteger s, ECPoint w)
-
AsymmetricECPrivateKey
public AsymmetricECPrivateKey(Algorithm ecAlg, byte[] encoding)
-
AsymmetricECPrivateKey
public AsymmetricECPrivateKey(Algorithm ecAlg, PrivateKeyInfo privateKeyInfo)
-
-
Method Detail
-
getEncoded
public final byte[] getEncoded()
Description copied from interface:AsymmetricKeyReturn an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.- Specified by:
getEncodedin interfaceAsymmetricKey- Returns:
- an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
-
getAlgorithm
public final Algorithm getAlgorithm()
Return the algorithm this Elliptic Curve key is for.- Specified by:
getAlgorithmin interfaceKey- Overrides:
getAlgorithmin classAsymmetricECKey- Returns:
- the key's algorithm.
-
getDomainParameters
public final ECDomainParameters getDomainParameters()
Return the Elliptic Curve domain parameters associated with this key.- Overrides:
getDomainParametersin classAsymmetricECKey- Returns:
- the EC domain parameters for the key.
-
getS
public java.math.BigInteger getS()
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfacejavax.security.auth.Destroyable
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:KeyReturn true if o is an equivalent key to this.
-
-