Class AsymmetricXDHPrivateKey
- java.lang.Object
-
- org.bouncycastle.crypto.asymmetric.AsymmetricXDHKey
-
- org.bouncycastle.crypto.asymmetric.AsymmetricXDHPrivateKey
-
- All Implemented Interfaces:
javax.security.auth.Destroyable,AsymmetricKey,AsymmetricPrivateKey,Key
public final class AsymmetricXDHPrivateKey extends AsymmetricXDHKey implements javax.security.auth.Destroyable, AsymmetricPrivateKey
Edwards Curve Diffie-Hellman (XDH) private keys.
-
-
Constructor Summary
Constructors Constructor Description AsymmetricXDHPrivateKey(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
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.byte[]getEncoded()Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.byte[]getPublicData()byte[]getSecret()inthashCode()Return the hashCode for the key.booleanisDestroyed()protected voidzeroize()-
Methods inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricXDHKey
checkApprovedOnlyModeStatus, getAlgorithm
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bouncycastle.crypto.Key
getAlgorithm
-
-
-
-
Constructor Detail
-
AsymmetricXDHPrivateKey
public AsymmetricXDHPrivateKey(Algorithm algorithm, byte[] keyData, byte[] publicData)
-
AsymmetricXDHPrivateKey
public AsymmetricXDHPrivateKey(byte[] encoding) throws java.io.IOExceptionConstruct a key from an encoding of a PrivateKeyInfo.- Parameters:
encoding- the DER encoding of the key.- Throws:
java.io.IOException
-
AsymmetricXDHPrivateKey
public AsymmetricXDHPrivateKey(PrivateKeyInfo keyInfo) throws java.io.IOException
Construct a key from a PrivateKeyInfo.- Parameters:
keyInfo- the PrivateKeyInfo containing the key.- Throws:
java.io.IOException
-
-
Method Detail
-
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 interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfacejavax.security.auth.Destroyable
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:KeyReturn true if o is an equivalent key to this.
-
-