Class AsymmetricDHPrivateKey
java.lang.Object
org.bouncycastle.crypto.asymmetric.AsymmetricDHKey
org.bouncycastle.crypto.asymmetric.AsymmetricDHPrivateKey
- All Implemented Interfaces:
Destroyable
,AsymmetricKey
,AsymmetricPrivateKey
,Key
Class for Diffie-Hellman private keys.
-
Constructor Summary
ConstructorsConstructorDescriptionAsymmetricDHPrivateKey
(Algorithm algorithm, byte[] enc) AsymmetricDHPrivateKey
(Algorithm algorithm, PrivateKeyInfo privateKeyInfo) AsymmetricDHPrivateKey
(Algorithm algorithm, DHDomainParameters params, BigInteger x) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
boolean
Return true if o is an equivalent key to this.final Algorithm
Return the algorithm this Diffie-Hellman key is for.final DHDomainParameters
Return the Diffie-Hellman domain parameters associated with this key.final byte[]
Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.getX()
int
hashCode()
Return the hashCode for the key.boolean
Methods inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricDHKey
checkApprovedOnlyModeStatus, isThreadCorrectMode, zeroize
-
Constructor Details
-
AsymmetricDHPrivateKey
-
AsymmetricDHPrivateKey
-
AsymmetricDHPrivateKey
-
-
Method Details
-
getAlgorithm
Return the algorithm this Diffie-Hellman key is for.- Specified by:
getAlgorithm
in interfaceKey
- Overrides:
getAlgorithm
in classAsymmetricDHKey
- Returns:
- the key's algorithm.
-
getDomainParameters
Return the Diffie-Hellman domain parameters associated with this key.- Overrides:
getDomainParameters
in classAsymmetricDHKey
- Returns:
- the Diffie-Hellman domain parameters for this key.
-
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.
-
getX
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyed
in interfaceDestroyable
-
hashCode
public int hashCode()Description copied from interface:Key
Return the hashCode for the key. -
equals
Description copied from interface:Key
Return true if o is an equivalent key to this.
-