Class AlgIdDSA

java.lang.Object
org.mozilla.jss.netscape.security.x509.AlgorithmId
org.mozilla.jss.netscape.security.x509.AlgIdDSA
All Implemented Interfaces:
Serializable, DSAParams, DerEncoder

public final class AlgIdDSA extends AlgorithmId implements DSAParams
This class identifies DSS/DSA Algorithm variants, which are distinguished by using different algorithm parameters P, Q, G. It uses the NIST/IETF standard DER encoding. These are used to implement the Digital Signature Standard (DSS), FIPS 186.

NOTE: At this time, DSS/DSA Algorithm IDs must always include these parameters. Use of DSS/DSA in modes where parameters are either implicit (e.g. a default applicable to a site or a larger scope), or are derived from some Certificate Authority's DSS certificate, is not currently supported.

Version:
1.31
See Also:
  • Field Details

  • Constructor Details

    • AlgIdDSA

      AlgIdDSA(DerValue val) throws IOException
      Throws:
      IOException
    • AlgIdDSA

      public AlgIdDSA(byte[] encodedAlg) throws IOException
      Construct an AlgIdDSA from an X.509 encoded byte array.
      Parameters:
      encodedAlg - byte array
      Throws:
      IOException
    • AlgIdDSA

      public AlgIdDSA(byte[] p, byte[] q, byte[] g) throws IOException
      Constructs a DSS/DSA Algorithm ID from unsigned integers that define the algorithm parameters. Those integers are encoded as big-endian byte arrays.
      Parameters:
      p - the DSS/DSA paramter "P"
      q - the DSS/DSA paramter "Q"
      g - the DSS/DSA paramter "G"
      Throws:
      IOException
    • AlgIdDSA

      public AlgIdDSA(BigInteger p, BigInteger q, BigInteger g)
      Constructs a DSS/DSA Algorithm ID from numeric parameters.
      Parameters:
      p - the DSS/DSA paramter "P"
      q - the DSS/DSA paramter "Q"
      g - the DSS/DSA paramter "G"
  • Method Details

    • getP

      public BigInteger getP()
      Returns the DSS/DSA parameter "P"
      Specified by:
      getP in interface DSAParams
    • getQ

      public BigInteger getQ()
      Returns the DSS/DSA parameter "Q"
      Specified by:
      getQ in interface DSAParams
    • getG

      public BigInteger getG()
      Returns the DSS/DSA parameter "G"
      Specified by:
      getG in interface DSAParams
    • getName

      public String getName()
      Returns "DSA", indicating the Digital Signature Algorithm (DSA) as defined by the Digital Signature Standard (DSS), FIPS 186.
      Overrides:
      getName in class AlgorithmId
      Returns:
      the name
    • initializeParams

      private void initializeParams() throws IOException
      Throws:
      IOException
    • decodeParams

      protected void decodeParams() throws IOException
      Parses algorithm parameters P, Q, and G. They're found in the "params" member, which never needs to be changed.
      Overrides:
      decodeParams in class AlgorithmId
      Throws:
      IOException
    • toString

      public String toString()
      Description copied from class: AlgorithmId
      Returns a string describing only the algorithm without parameters. Use toStringWithParams() for algorithm name and paramaters, or paramsToString() for just parameters.
      Overrides:
      toString in class AlgorithmId
      Returns:
      algorithm name
    • paramsToString

      protected String paramsToString()
      Description copied from class: AlgorithmId
      Provides a human-readable description of the algorithm parameters. This may be redefined by subclasses which parse those parameters.
      Overrides:
      paramsToString in class AlgorithmId
      Returns:
      algorithm parameters description
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AlgorithmId
    • equals

      public boolean equals(Object obj)
      Description copied from class: AlgorithmId
      Compares this AlgorithmID to another. If algorithm parameters are available, they are compared. Otherwise, just the object IDs for the algorithm are compared.
      Overrides:
      equals in class AlgorithmId
      Parameters:
      obj - preferably an AlgorithmId, else an ObjectIdentifier