Class AsymmetricDHPrivateKey
- java.lang.Object
-
- org.bouncycastle.crypto.asymmetric.AsymmetricDHKey
-
- org.bouncycastle.crypto.asymmetric.AsymmetricDHPrivateKey
-
- All Implemented Interfaces:
javax.security.auth.Destroyable,AsymmetricKey,AsymmetricPrivateKey,Key
public final class AsymmetricDHPrivateKey extends AsymmetricDHKey implements AsymmetricPrivateKey
Class for Diffie-Hellman private keys.
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricDHKey
algorithm, approvedModeOnly, domainParameters
-
-
Constructor Summary
Constructors Constructor Description AsymmetricDHPrivateKey(Algorithm algorithm, byte[] enc)AsymmetricDHPrivateKey(Algorithm algorithm, PrivateKeyInfo privateKeyInfo)AsymmetricDHPrivateKey(Algorithm algorithm, DHDomainParameters params, java.math.BigInteger x)
-
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 Diffie-Hellman key is for.DHDomainParametersgetDomainParameters()Return the Diffie-Hellman 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.BigIntegergetX()inthashCode()Return the hashCode for the key.booleanisDestroyed()-
Methods inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricDHKey
checkApprovedOnlyModeStatus, zeroize
-
-
-
-
Constructor Detail
-
AsymmetricDHPrivateKey
public AsymmetricDHPrivateKey(Algorithm algorithm, DHDomainParameters params, java.math.BigInteger x)
-
AsymmetricDHPrivateKey
public AsymmetricDHPrivateKey(Algorithm algorithm, byte[] enc)
-
AsymmetricDHPrivateKey
public AsymmetricDHPrivateKey(Algorithm algorithm, PrivateKeyInfo privateKeyInfo)
-
-
Method Detail
-
getAlgorithm
public final Algorithm getAlgorithm()
Return the algorithm this Diffie-Hellman key is for.- Specified by:
getAlgorithmin interfaceKey- Overrides:
getAlgorithmin classAsymmetricDHKey- Returns:
- the key's algorithm.
-
getDomainParameters
public final DHDomainParameters getDomainParameters()
Return the Diffie-Hellman domain parameters associated with this key.- Overrides:
getDomainParametersin classAsymmetricDHKey- Returns:
- the Diffie-Hellman domain parameters for this key.
-
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.
-
getX
public java.math.BigInteger getX()
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfacejavax.security.auth.Destroyable
-
hashCode
public int hashCode()
Description copied from interface:KeyReturn the hashCode for the key.
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:KeyReturn true if o is an equivalent key to this.
-
-