Top Description Fields Constructors Methods
org.bouncycastle.crypto.asymmetric

public final Class AsymmetricDSAPrivateKey

extends AsymmetricDSAKey
implements AsymmetricPrivateKey, Destroyable
Class Inheritance
All Implemented Interfaces
javax.security.auth.Destroyable, org.bouncycastle.crypto.AsymmetricPrivateKey, org.bouncycastle.crypto.AsymmetricKey, org.bouncycastle.crypto.Key
Imports
java.io.IOException, java.math.BigInteger, java.util.concurrent.atomic.AtomicBoolean, javax.security.auth.Destroyable, org.bouncycastle.asn1.ASN1Integer, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .DSAParameter, org.bouncycastle.asn1.x9.X9ObjectIdentifiers, org.bouncycastle.crypto.Algorithm, .AsymmetricPrivateKey, org.bouncycastle.crypto.internal.Permissions

Class for Digital Signature Algorithm (DSA) private keys.

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private int
private BigInteger
x

Inherited from org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey:
algorithmapprovedModeOnlydomainParameters

Constructor Summary

AccessConstructor and Description
public
public
AsymmetricDSAPrivateKey(Algorithm algorithm, byte[] enc)

public

Method Summary

Modifier and TypeMethod and Description
private int
public void
destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Destroy this Object.
public boolean
equals(Object
object to compare to.
o
)

Overrides java.lang.Object.equals.

Implements org.bouncycastle.crypto.Key.equals.

Return true if o is an equivalent key to this.
public final Algorithm

Returns:

the key's algorithm.
getAlgorithm
()

Overrides org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey.getAlgorithm.

Implements org.bouncycastle.crypto.Key.getAlgorithm.

Return the algorithm this DSA key is for.
public final DSADomainParameters

Returns:

the DSA domain parameters for this key.
getDomainParameters
()

Overrides org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey.getDomainParameters.

Return the DSA domain parameters associated with this key.
public final byte[]
getEncoded()

Implements org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
public final BigInteger
getX()

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements org.bouncycastle.crypto.Key.hashCode.

Return the hashCode for the key.
public boolean
isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.
private static BigInteger
Inherited from org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey:
checkApprovedOnlyModeStatuszeroize

Field Detail

hasBeenDestroyedback to summary
private final AtomicBoolean hasBeenDestroyed
hashCodeback to summary
private int hashCode
xback to summary
private BigInteger x

Constructor Detail

AsymmetricDSAPrivateKeyback to summary
public AsymmetricDSAPrivateKey(Algorithm algorithm, DSADomainParameters params, BigInteger x)
AsymmetricDSAPrivateKeyback to summary
public AsymmetricDSAPrivateKey(Algorithm algorithm, byte[] enc)
AsymmetricDSAPrivateKeyback to summary
public AsymmetricDSAPrivateKey(Algorithm algorithm, PrivateKeyInfo privateKeyInfo)

Method Detail

calculateHashCodeback to summary
private int calculateHashCode()
destroyback to summary
public void destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Doc from javax.security.auth.Destroyable.destroy.

Destroy this Object.

Sensitive information associated with this Object is destroyed or cleared. Subsequent calls to certain methods on this Object will result in an IllegalStateException being thrown.

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements org.bouncycastle.crypto.Key.equals.

Doc from org.bouncycastle.crypto.Key.equals.

Return true if o is an equivalent key to this.

Parameters
o:Object

object to compare to.

Returns:boolean

true if o is the same or equivalent key, false otherwise.

Annotations
@Override
getAlgorithmback to summary
public final Algorithm getAlgorithm()

Overrides org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey.getAlgorithm.

Implements org.bouncycastle.crypto.Key.getAlgorithm.

Return the algorithm this DSA key is for.

Returns:Algorithm

the key's algorithm.

getDomainParametersback to summary
public final DSADomainParameters getDomainParameters()

Overrides org.bouncycastle.crypto.asymmetric.AsymmetricDSAKey.getDomainParameters.

Return the DSA domain parameters associated with this key.

Returns:DSADomainParameters

the DSA domain parameters for this key.

getEncodedback to summary
public final byte[] getEncoded()

Implements org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Doc from org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.

Returns:byte[]

an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.

getXback to summary
public final BigInteger getX()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.bouncycastle.crypto.Key.hashCode.

Doc from org.bouncycastle.crypto.Key.hashCode.

Return the hashCode for the key.

Returns:int

the key's hashCode.

Annotations
@Override
isDestroyedback to summary
public boolean isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Doc from javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.

Returns:boolean

true if this Object has been destroyed, false otherwise.

parsePrivateKeyback to summary
private static BigInteger parsePrivateKey(PrivateKeyInfo info)