| java.lang.Object sun.security.x509.AlgorithmId sun.security.x509.AlgIdDSA
AlgIdDSA | final public class AlgIdDSA extends AlgorithmId implements DSAParams(Code) | | 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);
See Also: java.security.interfaces.DSAParams See Also: java.security.interfaces.DSAPublicKey See Also: java.security.KeyFactory See Also: java.security.spec.DSAPublicKeySpec version: 1.42, 10/10/06 author: David Brownell |
Constructor Summary | |
public | AlgIdDSA() Default constructor. | | AlgIdDSA(DerValue val) | public | AlgIdDSA(byte[] encodedAlg) Construct an AlgIdDSA from an X.509 encoded byte array. | public | AlgIdDSA(byte p, byte q, byte g) Constructs a DSS/DSA Algorithm ID from unsigned integers that
define the algorithm parameters. | public | AlgIdDSA(BigInteger p, BigInteger q, BigInteger g) 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. |
AlgIdDSA | public AlgIdDSA()(Code) | | Default constructor. The OID and parameters must be
deserialized before this algorithm ID is used.
|
AlgIdDSA | public AlgIdDSA(byte[] encodedAlg) throws IOException(Code) | | Construct an AlgIdDSA from an X.509 encoded byte array.
|
AlgIdDSA | public AlgIdDSA(byte p, byte q, byte g) throws IOException(Code) | | 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" Parameters: q - the DSS/DSA paramter "Q" Parameters: g - the DSS/DSA paramter "G" |
AlgIdDSA | public AlgIdDSA(BigInteger p, BigInteger q, BigInteger g)(Code) | | 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.
Parameters: p - the DSS/DSA paramter "P" Parameters: q - the DSS/DSA paramter "Q" Parameters: g - the DSS/DSA paramter "G" |
decodeParams | protected void decodeParams() throws IOException(Code) | | Parses algorithm parameters P, Q, and G. They're found
in the "params" member, which never needs to be changed.
|
getName | public String getName()(Code) | | Returns "DSA", indicating the Digital Signature Algorithm (DSA) as
defined by the Digital Signature Standard (DSS), FIPS 186.
|
|
|