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 TypeMethodDescriptionvoiddestroy()booleanReturn true if o is an equivalent key to this.final AlgorithmReturn the algorithm this Diffie-Hellman key is for.final DHDomainParametersReturn 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()inthashCode()Return the hashCode for the key.booleanMethods 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:
getAlgorithmin interfaceKey- Overrides:
getAlgorithmin classAsymmetricDHKey- Returns:
- the key's algorithm.
-
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
-
destroy
public void destroy()- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable
-
hashCode
public int hashCode()Description copied from interface:KeyReturn the hashCode for the key. -
equals
Description copied from interface:KeyReturn true if o is an equivalent key to this.
-