public final class

DSAPrivateKey

extends PKCS8Key
implements Serializable DSAPrivateKey
java.lang.Object
   ↳ sun.security.pkcs.PKCS8Key
     ↳ sun.security.provider.DSAPrivateKey

Class Overview

A PKCS#8 private key for the Digital Signature Algorithm.

See Also

Summary

[Expand]
Inherited Constants
From interface java.security.Key
From interface java.security.PrivateKey
From interface java.security.interfaces.DSAPrivateKey
[Expand]
Inherited Fields
From class sun.security.pkcs.PKCS8Key
Public Constructors
DSAPrivateKey()
DSAPrivateKey(BigInteger x, BigInteger p, BigInteger q, BigInteger g)
Make a DSA private key out of a private key and three parameters.
DSAPrivateKey(byte[] encoded)
Make a DSA private key from its DER encoding (PKCS #8).
Public Methods
DSAParams getParams()
Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.
BigInteger getX()
Get the raw private key, x, without the parameters.
String toString()
Returns a string representation of the object.
Protected Methods
void parseKeyBits()
Parse the key bits.
[Expand]
Inherited Methods
From class sun.security.pkcs.PKCS8Key
From class java.lang.Object
From interface java.security.Key
From interface java.security.interfaces.DSAKey
From interface java.security.interfaces.DSAPrivateKey

Public Constructors

public DSAPrivateKey ()

public DSAPrivateKey (BigInteger x, BigInteger p, BigInteger q, BigInteger g)

Make a DSA private key out of a private key and three parameters.

public DSAPrivateKey (byte[] encoded)

Make a DSA private key from its DER encoding (PKCS #8).

Public Methods

public DSAParams getParams ()

Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.

Returns
  • the DSA-specific key parameters.

public BigInteger getX ()

Get the raw private key, x, without the parameters.

Returns
  • the value of the private key, x.
See Also
  • getParameters

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.

Protected Methods

protected void parseKeyBits ()

Parse the key bits. This may be redefined by subclasses to take advantage of structure within the key. For example, RSA public keys encapsulate two unsigned integers (modulus and exponent) as DER values within the key bits; Diffie-Hellman and DSS/DSA keys encapsulate a single unsigned integer.

This function is called when creating PKCS#8 SubjectPublicKeyInfo values using the PKCS8Key member functions, such as parse and decode.