Class AsymmetricDSAPrivateKey
- java.lang.Object
-
- org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey
-
- org.bouncycastle.crypto.asymmetric.AsymmetricDSAPrivateKey
-
- All Implemented Interfaces:
javax.security.auth.Destroyable
,AsymmetricKey
,AsymmetricPrivateKey
,Key
public final class AsymmetricDSAPrivateKey extends AsymmetricDSAKey implements AsymmetricPrivateKey, javax.security.auth.Destroyable
Class for Digital Signature Algorithm (DSA) private keys.
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey
algorithm, approvedModeOnly, domainParameters
-
-
Constructor Summary
Constructors Constructor Description AsymmetricDSAPrivateKey(Algorithm algorithm, byte[] enc)
AsymmetricDSAPrivateKey(Algorithm algorithm, PrivateKeyInfo privateKeyInfo)
AsymmetricDSAPrivateKey(Algorithm algorithm, DSADomainParameters params, java.math.BigInteger x)
-
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.Algorithm
getAlgorithm()
Return the algorithm this DSA key is for.DSADomainParameters
getDomainParameters()
Return the DSA domain parameters associated with this key.byte[]
getEncoded()
Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.java.math.BigInteger
getX()
int
hashCode()
Return the hashCode for the key.boolean
isDestroyed()
-
Methods inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey
checkApprovedOnlyModeStatus, zeroize
-
-
-
-
Constructor Detail
-
AsymmetricDSAPrivateKey
public AsymmetricDSAPrivateKey(Algorithm algorithm, DSADomainParameters params, java.math.BigInteger x)
-
AsymmetricDSAPrivateKey
public AsymmetricDSAPrivateKey(Algorithm algorithm, byte[] enc)
-
AsymmetricDSAPrivateKey
public AsymmetricDSAPrivateKey(Algorithm algorithm, PrivateKeyInfo privateKeyInfo)
-
-
Method Detail
-
getAlgorithm
public final Algorithm getAlgorithm()
Return the algorithm this DSA key is for.- Specified by:
getAlgorithm
in interfaceKey
- Overrides:
getAlgorithm
in classAsymmetricDSAKey
- Returns:
- the key's algorithm.
-
getDomainParameters
public final DSADomainParameters getDomainParameters()
Return the DSA domain parameters associated with this key.- Overrides:
getDomainParameters
in classAsymmetricDSAKey
- Returns:
- the DSA 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
public final java.math.BigInteger getX()
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyed
in interfacejavax.security.auth.Destroyable
-
hashCode
public int hashCode()
Description copied from interface:Key
Return the hashCode for the key.
-
equals
public boolean equals(java.lang.Object o)
Description copied from interface:Key
Return true if o is an equivalent key to this.
-
-