Class AsymmetricXDHPrivateKey
java.lang.Object
org.bouncycastle.crypto.asymmetric.AsymmetricXDHKey
org.bouncycastle.crypto.asymmetric.AsymmetricXDHPrivateKey
- All Implemented Interfaces:
Destroyable,AsymmetricKey,AsymmetricPrivateKey,Key
Edwards Curve Diffie-Hellman (XDH) private keys.
-
Constructor Summary
ConstructorsConstructorDescriptionAsymmetricXDHPrivateKey(byte[] encoding) Construct a key from an encoding of a PrivateKeyInfo.AsymmetricXDHPrivateKey(PrivateKeyInfo keyInfo) Construct a key from a PrivateKeyInfo.AsymmetricXDHPrivateKey(Algorithm algorithm, byte[] keyData, byte[] publicData) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()booleanReturn true if o is an equivalent key to this.byte[]Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.byte[]byte[]inthashCode()Return the hashCode for the key.booleanprotected voidzeroize()Methods inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricXDHKey
checkApprovedOnlyModeStatus, getAlgorithm, isThreadCorrectModeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bouncycastle.crypto.Key
getAlgorithm
-
Constructor Details
-
AsymmetricXDHPrivateKey
-
AsymmetricXDHPrivateKey
Construct a key from an encoding of a PrivateKeyInfo.- Parameters:
encoding- the DER encoding of the key.- Throws:
IOException
-
AsymmetricXDHPrivateKey
Construct a key from a PrivateKeyInfo.- Parameters:
keyInfo- the PrivateKeyInfo containing the key.- Throws:
IOException
-
-
Method Details
-
getSecret
public byte[] getSecret() -
getPublicData
public byte[] getPublicData() -
getEncoded
public 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.
-
zeroize
protected void zeroize()- Overrides:
zeroizein classAsymmetricXDHKey
-
destroy
public void destroy()- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable
-
equals
Description copied from interface:KeyReturn true if o is an equivalent key to this. -
hashCode
public int hashCode()Description copied from interface:KeyReturn the hashCode for the key.
-