Class DSAPrivateKey

java.lang.Object
org.mozilla.jss.netscape.security.pkcs.PKCS8Key
org.mozilla.jss.netscape.security.provider.DSAPrivateKey
All Implemented Interfaces:
Serializable, DSAKey, DSAPrivateKey, Key, PrivateKey, Destroyable

public final class DSAPrivateKey extends PKCS8Key implements DSAPrivateKey
A PKCS#8 private key for the Digital Signature Algorithm.
Version:
1.47, 97/12/10
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      use serialVersionUID from JDK 1.1. for interoperability
      See Also:
    • x

      private BigInteger x
  • Constructor Details

  • Method Details

    • getParams

      public DSAParams getParams()
      Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.
      Specified by:
      getParams in interface DSAKey
    • getX

      public BigInteger getX()
      Get the raw private key, x, without the parameters.
      Specified by:
      getX in interface DSAPrivateKey
    • clearOldKey

      private void clearOldKey()
    • toString

      public String toString()
      Overrides:
      toString in class PKCS8Key
    • parseKeyBits

      protected void parseKeyBits() throws InvalidKeyException
      Description copied from class: PKCS8Key
      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.

      Overrides:
      parseKeyBits in class PKCS8Key
      Throws:
      InvalidKeyException - if the key encoding is invalid.
    • hashCode

      public int hashCode()
      Description copied from class: PKCS8Key
      Calculates a hash code value for this object. Objects which are equal will also have the same hashcode.
      Overrides:
      hashCode in class PKCS8Key
    • equals

      public boolean equals(Object obj)
      Description copied from class: PKCS8Key
      Compares two private keys. This returns false if the object with which to compare is not of type Key. Otherwise, the encoding of this key object is compared with the encoding of the given key object.
      Overrides:
      equals in class PKCS8Key
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this key has the same encoding as the object argument; false otherwise.