public final class AlgIdDSA
extends com.tencent.kona.sun.security.x509.AlgorithmId
implements java.security.interfaces.DSAParams
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);
DSAParams,
DSAPublicKey,
KeyFactory,
DSAPublicKeySpec,
Serialized FormDSA_oid, EC_oid, ed25519_oid, ed448_oid, encodedParams, MD2_oid, MD2withRSA_oid, MD5_oid, MD5withRSA_oid, MGF1_oid, RSAEncryption_oid, RSASSA_PSS_oid, SHA_oid, SHA1withECDSA_oid, SHA1withRSA_oid, SHA224_oid, SHA224withECDSA_oid, SHA224withRSA_oid, SHA256_oid, SHA256withECDSA_oid, SHA256withRSA_oid, SHA3_224_oid, SHA3_224withRSA_oid, SHA3_256_oid, SHA3_256withRSA_oid, SHA3_384_oid, SHA3_384withRSA_oid, SHA3_512_oid, SHA3_512withRSA_oid, SHA384_oid, SHA384withECDSA_oid, SHA384withRSA_oid, SHA512_224_oid, SHA512_256_oid, SHA512_oid, SHA512$224withRSA_oid, SHA512$256withRSA_oid, SHA512withECDSA_oid, SHA512withRSA_oid, SM2_OID, SM3_OID, SM3withSM2_OID, x25519_oid, x448_oid| Constructor and Description |
|---|
AlgIdDSA()
Deprecated.
|
AlgIdDSA(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g)
Constructs a DSS/DSA Algorithm ID from numeric parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
decodeParams()
Parses algorithm parameters P, Q, and G.
|
java.math.BigInteger |
getG()
Returns the DSS/DSA parameter "G"
|
java.lang.String |
getName()
Returns "DSA", indicating the Digital Signature Algorithm (DSA) as
defined by the Digital Signature Standard (DSS), FIPS 186.
|
java.math.BigInteger |
getP()
Returns the DSS/DSA parameter "P"
|
java.math.BigInteger |
getQ()
Returns the DSS/DSA parameter "Q"
|
protected java.lang.String |
paramsToString() |
java.lang.String |
toString() |
@Deprecated public AlgIdDSA()
public AlgIdDSA(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g)
p - the DSS/DSA parameter "P"q - the DSS/DSA parameter "Q"g - the DSS/DSA parameter "G"public java.math.BigInteger getP()
getP in interface java.security.interfaces.DSAParamspublic java.math.BigInteger getQ()
getQ in interface java.security.interfaces.DSAParamspublic java.math.BigInteger getG()
getG in interface java.security.interfaces.DSAParamspublic java.lang.String getName()
getName in class com.tencent.kona.sun.security.x509.AlgorithmIdprotected void decodeParams()
throws java.io.IOException
decodeParams in class com.tencent.kona.sun.security.x509.AlgorithmIdjava.io.IOExceptionpublic java.lang.String toString()
toString in class com.tencent.kona.sun.security.x509.AlgorithmIdprotected java.lang.String paramsToString()
paramsToString in class com.tencent.kona.sun.security.x509.AlgorithmId