APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.provider

pack-priv abstract Class DSA

extends SignatureSpi
Class Inheritance
Known Direct Subclasses
sun.security.provider.DSA.SHA3_224withDSA, sun.security.provider.DSA.SHA3_224withDSAinP1363Format, sun.security.provider.DSA.SHA3_256withDSA, sun.security.provider.DSA.SHA3_256withDSAinP1363Format, sun.security.provider.DSA.SHA3_384withDSA, sun.security.provider.DSA.SHA3_384withDSAinP1363Format, sun.security.provider.DSA.SHA3_512withDSA, sun.security.provider.DSA.SHA3_512withDSAinP1363Format, sun.security.provider.DSA.SHA224withDSA, sun.security.provider.DSA.SHA224withDSAinP1363Format, sun.security.provider.DSA.SHA256withDSA, sun.security.provider.DSA.SHA256withDSAinP1363Format, sun.security.provider.DSA.SHA384withDSA, sun.security.provider.DSA.SHA384withDSAinP1363Format, sun.security.provider.DSA.SHA512withDSA, sun.security.provider.DSA.SHA512withDSAinP1363Format, sun.security.provider.DSA.SHA1withDSA, sun.security.provider.DSA.SHA1withDSAinP1363Format, sun.security.provider.DSA.Raw
Imports
java.io.*, java.util.*, java.math.BigInteger, java.nio.ByteBuffer, java.security.*, .SecureRandom, java.security.interfaces.*, java.security.spec.*, sun.security.util.Debug, .DerValue, .DerInputStream, .DerOutputStream, sun.security.jca.JCAUtil

The Digital Signature Standard (using the Digital Signature Algorithm), as described in fips186-3 of the National Institute of Standards and Technology (NIST), using SHA digest algorithms from FIPS180-3. This file contains the signature implementation for the SHA1withDSA (DSS), SHA224withDSA, SHA256withDSA, SHA384withDSA, SHA512withDSA, SHA3-224withDSA, SHA3-256withDSA, SHA3-384withDSA, SHA3-512withDSA, as well as RawDSA, used by TLS among others. RawDSA expects the 20 byte SHA-1 digest as input via update rather than the original data like other signature implementations. In addition, IEEE P1363 signature format is supported. The corresponding implementation is registered under inP1363Format, e.g. SHA256withDSAinP1363Format.
Author
Benjamin Renaud
Since
1.1
See Also
DSAPublicKey, DSAPrivateKey

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
DSA.Raw

Raw DSA.

public static class
DSA.RawDSA

Standard Raw DSA implementation.

public static class
DSA.RawDSAinP1363Format

Raw DSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA1withDSA

Standard SHA1withDSA implementation.

public static class
DSA.SHA1withDSAinP1363Format

SHA1withDSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA224withDSA

Standard SHA224withDSA implementation as defined in FIPS186-3.

public static class
DSA.SHA224withDSAinP1363Format

SHA224withDSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA256withDSA

Standard SHA256withDSA implementation as defined in FIPS186-3.

public static class
DSA.SHA256withDSAinP1363Format

SHA256withDSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA384withDSA

Standard SHA384withDSA implementation as defined in FIPS186-3.

public static class
DSA.SHA384withDSAinP1363Format

SHA384withDSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA3_224withDSA

SHA3-224withDSA implementation.

public static class
DSA.SHA3_224withDSAinP1363Format

SHA3-224withDSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA3_256withDSA

Standard SHA3-256withDSA implementation.

public static class
DSA.SHA3_256withDSAinP1363Format

Standard SHA3-256withDSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA3_384withDSA

Standard SHA3-384withDSA implementation.

public static class
DSA.SHA3_384withDSAinP1363Format

Standard SHA3-384withDSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA3_512withDSA

Standard SHA3-512withDSA implementation.

public static class
DSA.SHA3_512withDSAinP1363Format

Standard SHA3-512withDSA implementation that uses the IEEE P1363 format.

public static class
DSA.SHA512withDSA

Standard SHA512withDSA implementation as defined in FIPS186-3.

public static class
DSA.SHA512withDSAinP1363Format

SHA512withDSA implementation that uses the IEEE P1363 format.

Field Summary

Modifier and TypeField and Description
private static final int
private static final BigInteger
private static final boolean
private final MessageDigest
private final boolean
private DSAParams
private BigInteger
private BigInteger
private BigInteger
private BigInteger
private BigInteger
private SecureRandom
Inherited from java.security.SignatureSpi:
appRandom

Constructor Summary

AccessConstructor and Description
pack-priv
DSA(MessageDigest md)

Construct a blank DSA object.

pack-priv
DSA(MessageDigest md, boolean p1363Format)

Construct a blank DSA object that will use the specified signature format.

Method Summary

Modifier and TypeMethod and Description
private static void
checkKey(DSAParams params, int digestLen, String mdAlgo)

protected Object
engineGetParameter(String key)

Implements abstract java.security.SignatureSpi.engineGetParameter.

Deprecated

Gets the value of the specified algorithm parameter.

protected AlgorithmParameters
engineGetParameters()

Overrides java.security.SignatureSpi.engineGetParameters.

Returns the parameters used with this Signature object.

protected void
engineInitSign(PrivateKey
the DSA private key
privateKey
)

Implements abstract java.security.SignatureSpi.engineInitSign.

Initialize the DSA object with a DSA private key.

protected void
engineInitVerify(PublicKey
the DSA public key.
publicKey
)

Implements abstract java.security.SignatureSpi.engineInitVerify.

Initialize the DSA object with a DSA public key.

protected void
engineSetParameter(String key, Object param)

Implements abstract java.security.SignatureSpi.engineSetParameter.

Deprecated

Sets the specified algorithm parameter to the specified value.

protected void
engineSetParameter(AlgorithmParameterSpec params)

Overrides java.security.SignatureSpi.engineSetParameter.

Initializes this Signature object with the specified parameter values.

protected byte[]

Returns:

a signature block formatted according to the format indicated by p1363Format
engineSign
()

Implements abstract java.security.SignatureSpi.engineSign.

Sign all the data thus far updated.

protected void
engineUpdate(byte b)

Implements abstract java.security.SignatureSpi.engineUpdate.

Update a byte to be signed or verified.

protected void
engineUpdate(byte[] data, int off, int len)

Implements abstract java.security.SignatureSpi.engineUpdate.

Update an array of bytes to be signed or verified.

protected void
engineUpdate(ByteBuffer b)

Overrides java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified using the specified ByteBuffer.

protected boolean
engineVerify(byte[]
the alleged signature, encoded using the Canonical Encoding Rules, as a sequence of integers, r and s.
signature
)

Implements abstract java.security.SignatureSpi.engineVerify.

Verify all the data thus far updated.

protected boolean
engineVerify(byte[]
the alleged signature, encoded using the format indicated by p1363Format. If p1363Format is false (the default), then the signature is formatted according to the Canonical Encoding Rules, as a DER sequence of Integers, r and s. If p1363Format is false, the signature is in the IEEE P1363 format, which is the concatenation or r and s.
signature
,
int
the offset to start from in the array of bytes.
offset
,
int
the number of bytes to use, starting at offset.
length
)

Overrides java.security.SignatureSpi.engineVerify.

Verify all the data thus far updated.

protected BigInteger
private BigInteger
private BigInteger
private BigInteger
private BigInteger
protected SecureRandom
public String
toString()

Overrides java.lang.Object.toString.

Return a human-readable rendition of the engine.

Inherited from java.security.SignatureSpi:
cloneengineInitSignengineSign