Top Description Fields Constructors Methods
sun.security.provider

public Class DSAPublicKey

extends X509Key
implements DSAPublicKey, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.security.interfaces.DSAPublicKey, java.security.PublicKey, java.security.AsymmetricKey, java.security.Key, java.security.interfaces.DSAKey
Known Direct Subclasses
sun.security.provider.DSAPublicKeyImpl
Imports
java.io.IOException, .Serializable, java.math.BigInteger, java.security.AlgorithmParameters, .InvalidKeyException, java.security.interfaces.DSAParams, java.security.spec.DSAParameterSpec, .InvalidParameterSpecException, sun.security.util.BitArray, .Debug, .DerInputStream, .DerValue, sun.security.x509.AlgIdDSA, .X509Key

An X.509 public key for the Digital Signature Algorithm.
Author
Benjamin Renaud
See Also
DSAPrivateKey, AlgIdDSA, DSA

Field Summary

Modifier and TypeField and Description
private static final long
private BigInteger
y

Inherited from sun.security.x509.X509Key:
algidencodedKey

Constructor Summary

AccessConstructor and Description
public
public
DSAPublicKey(BigInteger
the actual key bits
y
,
BigInteger
DSA parameter p, may be null if all of p, q, and g are null.
p
,
BigInteger
DSA parameter q, may be null if all of p, q, and g are null.
q
,
BigInteger
DSA parameter g, may be null if all of p, q, and g are null.
g
)

Make a DSA public key out of a public key and three parameters.

public
DSAPublicKey(byte[] encoded)

Make a DSA public key from its DER encoding (X.509).

Method Summary

Modifier and TypeMethod and Description
public DSAParams
getParams()

Overrides default java.security.interfaces.DSAPublicKey.getParams, java.security.AsymmetricKey.getParams.

Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.

public BigInteger
getY()

Implements java.security.interfaces.DSAPublicKey.getY.

Get the raw public value, y, without the parameters.

protected void
parseKeyBits()

Overrides sun.security.x509.X509Key.parseKeyBits.

Parse the key bits.

public String
toString()

Overrides sun.security.x509.X509Key.toString.

Returns a string representation of the object.

Inherited from sun.security.x509.X509Key:
decodeencodeencodeequalsgetAlgorithmgetAlgorithmIdgetEncodedgetEncodedInternalgetFormatgetKeyhashCodeparsesetKey

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides sun.security.x509.X509Key.serialVersionUID, java.security.interfaces.DSAPublicKey.serialVersionUID, java.security.PublicKey.serialVersionUID.

use serialVersionUID from JDK 1.1. for interoperability

Annotations
@Serial
yback to summary
private BigInteger y

Constructor Detail

DSAPublicKeyback to summary
public DSAPublicKey()
DSAPublicKeyback to summary
public DSAPublicKey(BigInteger y, BigInteger p, BigInteger q, BigInteger g)

Make a DSA public key out of a public key and three parameters. The p, q, and g parameters may be null, but if so, parameters will need to be supplied from some other source before this key can be used in cryptographic operations. PKIX RFC2459bis explicitly allows DSA public keys without parameters, where the parameters are provided in the issuer's DSA public key.

Parameters
y:BigInteger

the actual key bits

p:BigInteger

DSA parameter p, may be null if all of p, q, and g are null.

q:BigInteger

DSA parameter q, may be null if all of p, q, and g are null.

g:BigInteger

DSA parameter g, may be null if all of p, q, and g are null.

Annotations
@SuppressWarnings:this-escape
DSAPublicKeyback to summary
public DSAPublicKey(byte[] encoded) throws InvalidKeyException

Make a DSA public key from its DER encoding (X.509).

Annotations
@SuppressWarnings:this-escape

Method Detail

getParamsback to summary
public DSAParams getParams()

Overrides default java.security.interfaces.DSAPublicKey.getParams, java.security.AsymmetricKey.getParams.

Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.

Returns:DSAParams

Doc from java.security.interfaces.DSAPublicKey.getParams.

the associated parameters, may be null

getYback to summary
public BigInteger getY()

Implements java.security.interfaces.DSAPublicKey.getY.

Get the raw public value, y, without the parameters.

Returns:BigInteger

Doc from java.security.interfaces.DSAPublicKey.getY.

the value of the public key, y.

See Also
getParameters
parseKeyBitsback to summary
protected void parseKeyBits() throws InvalidKeyException

Overrides sun.security.x509.X509Key.parseKeyBits.

Doc from sun.security.x509.X509Key.parseKeyBits.

Parse the key bits. This may be redefined by subclasses to take advantage of structure within the key. For example, RSA public keys encapsulate two unsigned integers (modulus and exponent) as DER values within the key bits; Diffie-Hellman and DSS/DSA keys encapsulate a single unsigned integer.

This function is called when creating X.509 SubjectPublicKeyInfo values using the X509Key member functions, such as parse and decode.

Exceptions
InvalidKeyException:
on invalid key encodings.
toStringback to summary
public String toString()

Overrides sun.security.x509.X509Key.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object