public class

DSAPublicKey

extends X509Key
implements Serializable DSAPublicKey
java.lang.Object
   ↳ sun.security.x509.X509Key
     ↳ sun.security.provider.DSAPublicKey
Known Direct Subclasses

Class Overview

An X.509 public key for the Digital Signature Algorithm.

See Also

Summary

[Expand]
Inherited Constants
From interface java.security.Key
From interface java.security.PublicKey
From interface java.security.interfaces.DSAPublicKey
[Expand]
Inherited Fields
From class sun.security.x509.X509Key
Public Constructors
DSAPublicKey()
DSAPublicKey(BigInteger y, BigInteger p, BigInteger q, BigInteger g)
Make a DSA public key out of a public key and three parameters.
DSAPublicKey(byte[] encoded)
Make a DSA public key from its DER encoding (X.509).
Public Methods
DSAParams getParams()
Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.
BigInteger getY()
Get the raw public value, y, without the parameters.
String toString()
Returns a string representation of the object.
Protected Methods
void parseKeyBits()
Parse the key bits.
[Expand]
Inherited Methods
From class sun.security.x509.X509Key
From class java.lang.Object
From interface java.security.Key
From interface java.security.interfaces.DSAKey
From interface java.security.interfaces.DSAPublicKey

Public Constructors

public DSAPublicKey ()

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 the actual key bits
p DSA parameter p, may be null if all of p, q, and g are null.
q DSA parameter q, may be null if all of p, q, and g are null.
g DSA parameter g, may be null if all of p, q, and g are null.

public DSAPublicKey (byte[] encoded)

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

Public Methods

public DSAParams getParams ()

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

Returns
  • the DSA-specific key parameters.

public BigInteger getY ()

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

Returns
  • the value of the public key, y.
See Also
  • getParameters

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.

Protected Methods

protected void 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.