java.lang.Object | ||
↳ | sun.security.x509.AlgorithmId | |
↳ | sun.security.x509.AlgIdDSA |
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: DSS/DSA Algorithm IDs may be created without 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 supported directly. The application is responsible for creating a key
containing the required parameters prior to using the key in cryptographic
operations. The follwoing is an example of how this may be done assuming
that we have a certificate called
currentCert
which doesn't
contain DSS/DSA parameters and we need to derive DSS/DSA parameters
from a CA's certificate called caCert
.
// key containing parameters to use
DSAPublicKey cAKey = (DSAPublicKey)(caCert.getPublicKey());
// key without parameters
DSAPublicKey nullParamsKey = (DSAPublicKey)(currentCert.getPublicKey());
DSAParams cAKeyParams = cAKey.getParams();
KeyFactory kf = KeyFactory.getInstance("DSA");
DSAPublicKeySpec ks = new DSAPublicKeySpec(nullParamsKey.getY(),
cAKeyParams.getP(),
cAKeyParams.getQ(),
cAKeyParams.getG());
DSAPublicKey usableKey = kf.generatePublic(ks);
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default constructor.
| |||||||||||
Construct an AlgIdDSA from an X.509 encoded byte array.
| |||||||||||
Constructs a DSS/DSA Algorithm ID from unsigned integers that
define the algorithm parameters.
| |||||||||||
Constructs a DSS/DSA Algorithm ID from numeric parameters.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the DSS/DSA parameter "G"
| |||||||||||
Returns "DSA", indicating the Digital Signature Algorithm (DSA) as
defined by the Digital Signature Standard (DSS), FIPS 186.
| |||||||||||
Returns the DSS/DSA parameter "P"
| |||||||||||
Returns the DSS/DSA parameter "Q"
| |||||||||||
Returns a string describing the algorithm and its parameters.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parses algorithm parameters P, Q, and G.
| |||||||||||
Provides a human-readable description of the algorithm parameters.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Default constructor. The OID and parameters must be deserialized before this algorithm ID is used.
Construct an AlgIdDSA from an X.509 encoded byte array.
IOException |
---|
Constructs a DSS/DSA Algorithm ID from unsigned integers that define the algorithm parameters. Those integers are encoded as big-endian byte arrays.
p | the DSS/DSA paramter "P" |
---|---|
q | the DSS/DSA paramter "Q" |
g | the DSS/DSA paramter "G" |
IOException |
---|
Constructs a DSS/DSA Algorithm ID from numeric parameters. If all three are null, then the parameters portion of the algorithm id is set to null. See note in header regarding use.
p | the DSS/DSA paramter "P" |
---|---|
q | the DSS/DSA paramter "Q" |
g | the DSS/DSA paramter "G" |
Returns "DSA", indicating the Digital Signature Algorithm (DSA) as defined by the Digital Signature Standard (DSS), FIPS 186.
Returns a string describing the algorithm and its parameters.
Parses algorithm parameters P, Q, and G. They're found in the "params" member, which never needs to be changed.
IOException |
---|
Provides a human-readable description of the algorithm parameters. This may be redefined by subclasses which parse those parameters.