de.flexiprovider.core.dsa
Class DSAPrivateKey

java.lang.Object
  |
  +--de.flexiprovider.api.keys.PrivateKey
        |
        +--de.flexiprovider.core.dsa.interfaces.DSAPrivateKey
              |
              +--de.flexiprovider.core.dsa.DSAPrivateKey
All Implemented Interfaces:
DSAKey, java.security.interfaces.DSAKey, java.security.interfaces.DSAPrivateKey, Key, java.security.Key, java.security.PrivateKey, java.io.Serializable

public class DSAPrivateKey
extends DSAPrivateKey

This class implements the DSAPrivateKey interface.

Author:
Thomas Wahrenbruch
See Also:
Serialized Form

Fields inherited from interface java.security.interfaces.DSAPrivateKey
serialVersionUID
 
Constructor Summary
protected DSAPrivateKey(DSAPrivateKeySpec keySpec)
          Construct a DSA private key from the given key specification (used by the DSAKeyFactory).
protected DSAPrivateKey(FlexiBigInt x, DSAParams params)
          Construct a DSA private key with the specified parameters (used by the DSAKeyPairGenerator).
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAlgorithm()
          This function returns the name of the corresponding algorithm "DSA".
protected  codec.asn1.ASN1Type getAlgParams()
           
protected  byte[] getKeyData()
           
protected  codec.asn1.ASN1ObjectIdentifier getOID()
           
 DSAParams getParameters()
          This function returns the DSA parameters.
 FlexiBigInt getValueX()
          This function returns the secret exponent x.
 int hashCode()
           
 java.lang.String toString()
          Returns a human readable form of the key.
 
Methods inherited from class de.flexiprovider.core.dsa.interfaces.DSAPrivateKey
getParams, getX
 
Methods inherited from class de.flexiprovider.api.keys.PrivateKey
getEncoded, getFormat
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Key
getEncoded, getFormat
 

Constructor Detail

DSAPrivateKey

protected DSAPrivateKey(FlexiBigInt x,
                        DSAParams params)
Construct a DSA private key with the specified parameters (used by the DSAKeyPairGenerator).
Parameters:
x - the secret exponent.
params - the DSA parameters.

DSAPrivateKey

protected DSAPrivateKey(DSAPrivateKeySpec keySpec)
Construct a DSA private key from the given key specification (used by the DSAKeyFactory).
Parameters:
keySpec - the key specification
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
This function returns the name of the corresponding algorithm "DSA".
Returns:
"DSA".

getParameters

public DSAParams getParameters()
This function returns the DSA parameters.
Returns:
the DSA parameters.

getValueX

public FlexiBigInt getValueX()
This function returns the secret exponent x.
Overrides:
getValueX in class DSAPrivateKey
Returns:
the secret exponent x.

toString

public java.lang.String toString()
Returns a human readable form of the key.
Overrides:
toString in class java.lang.Object
Returns:
a human readable form of the key.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getOID

protected codec.asn1.ASN1ObjectIdentifier getOID()
Overrides:
getOID in class PrivateKey
Returns:
the OID to encode in the SubjectPublicKeyInfo structure

getAlgParams

protected codec.asn1.ASN1Type getAlgParams()
Overrides:
getAlgParams in class PrivateKey
Returns:
the algorithm parameters to encode in the SubjectPublicKeyInfo structure

getKeyData

protected byte[] getKeyData()
Overrides:
getKeyData in class PrivateKey
Returns:
the keyData to encode in the SubjectPublicKeyInfo structure