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 void
destroy()
boolean
equals(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()
int
hashCode()
Return the hashCode for the key.boolean
isDestroyed()
protected void
zeroize()
-
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.IOException
Construct 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: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.
-
zeroize
protected void zeroize()
- Overrides:
zeroize
in classAsymmetricXDHKey
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyed
in interfacejavax.security.auth.Destroyable
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:Key
Return true if o is an equivalent key to this.
-
-