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
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 Summary
FieldsModifier and TypeFieldDescriptionprivate BigInteger
private BigInteger
private BigInteger
private static final long
Fields inherited from class org.mozilla.jss.netscape.security.x509.AlgorithmId
ALL_SIGNING_ALGORITHMS, ANSIX962_EC_Public_Key_oid, ANSIX962_SHA1_With_EC_oid, DH_oid, DH_PKIX_oid, DSA_oid, DSA_OIW_oid, DSA_SIGNING_ALGORITHMS, EC_SIGNING_ALGORITHMS, MD2_oid, md2WithRSAEncryption_oid, MD5_oid, md5WithRSAEncryption_oid, MGF1_oid, params, paramsString, RSA_oid, RSA_SIGNING_ALGORITHMS, RSAEncryption_oid, rsaPSS_oid, SHA_oid, sha1WithDSA_oid, sha1WithDSA_OIW_oid, sha1WithEC_oid, sha1WithRSAEncryption_oid, sha1WithRSAEncryption_OIW_oid, sha224WithEC_oid, SHA256_oid, sha256WithEC_oid, sha256WithRSAEncryption_oid, SHA384_oid, sha384WithEC_oid, sha384WithRSAEncryption_oid, SHA512_oid, sha512WithEC_oid, sha512WithRSAEncryption_oid, shaWithDSA_OIW_oid
-
Constructor Summary
ConstructorsConstructorDescriptionAlgIdDSA
(byte[] encodedAlg) Construct an AlgIdDSA from an X.509 encoded byte array.AlgIdDSA
(byte[] p, byte[] q, byte[] g) Constructs a DSS/DSA Algorithm ID from unsigned integers that define the algorithm parameters.AlgIdDSA
(BigInteger p, BigInteger q, BigInteger g) Constructs a DSS/DSA Algorithm ID from numeric parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Parses algorithm parameters P, Q, and G.boolean
Compares this AlgorithmID to another.getG()
Returns the DSS/DSA parameter "G"getName()
Returns "DSA", indicating the Digital Signature Algorithm (DSA) as defined by the Digital Signature Standard (DSS), FIPS 186.getP()
Returns the DSS/DSA parameter "P"getQ()
Returns the DSS/DSA parameter "Q"int
hashCode()
private void
protected String
Provides a human-readable description of the algorithm parameters.toString()
Returns a string describing only the algorithm without parameters.Methods inherited from class org.mozilla.jss.netscape.security.x509.AlgorithmId
createPSSAlgorithmParameters, createPSSAlgorithmParametersFromData, derEncode, derEncodeWithContext, encode, encode, equals, equals, get, getEncodedParams, getOID, getParameters, getParametersString, getSigningAlgorithms, parse, parse, setParametersString, toStringWithParams
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
p
-
q
-
g
-
-
Constructor Details
-
AlgIdDSA
AlgIdDSA(DerValue val) throws IOException - Throws:
IOException
-
AlgIdDSA
Construct an AlgIdDSA from an X.509 encoded byte array.- Parameters:
encodedAlg
- byte array- Throws:
IOException
-
AlgIdDSA
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
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
Returns the DSS/DSA parameter "P" -
getQ
Returns the DSS/DSA parameter "Q" -
getG
Returns the DSS/DSA parameter "G" -
getName
Returns "DSA", indicating the Digital Signature Algorithm (DSA) as defined by the Digital Signature Standard (DSS), FIPS 186.- Overrides:
getName
in classAlgorithmId
- Returns:
- the name
-
initializeParams
- Throws:
IOException
-
decodeParams
Parses algorithm parameters P, Q, and G. They're found in the "params" member, which never needs to be changed.- Overrides:
decodeParams
in classAlgorithmId
- Throws:
IOException
-
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 classAlgorithmId
- Returns:
- algorithm name
-
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 classAlgorithmId
- Returns:
- algorithm parameters description
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAlgorithmId
-
equals
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 classAlgorithmId
- Parameters:
obj
- preferably an AlgorithmId, else an ObjectIdentifier
-