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 void
destroy()
boolean
equals(java.lang.Object o)
Return true if o is an equivalent key to this.Algorithm
getAlgorithm()
Return the algorithm this Elliptic Curve key is for.ECDomainParameters
getDomainParameters()
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.BigInteger
getS()
int
hashCode()
Return the hashCode for the key.boolean
isDestroyed()
-
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:AsymmetricKey
Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.- Specified by:
getEncoded
in 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:
getAlgorithm
in interfaceKey
- Overrides:
getAlgorithm
in classAsymmetricECKey
- Returns:
- the key's algorithm.
-
getDomainParameters
public final ECDomainParameters getDomainParameters()
Return the Elliptic Curve domain parameters associated with this key.- Overrides:
getDomainParameters
in classAsymmetricECKey
- Returns:
- the EC domain parameters for the key.
-
getS
public java.math.BigInteger getS()
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyed
in interfacejavax.security.auth.Destroyable
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:Key
Return true if o is an equivalent key to this.
-
-