Package netscape.security.provider
Class DSAPublicKey
- java.lang.Object
-
- netscape.security.x509.X509Key
-
- netscape.security.provider.DSAPublicKey
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.interfaces.DSAKey
,java.security.interfaces.DSAPublicKey
,java.security.Key
,java.security.PublicKey
public final class DSAPublicKey extends X509Key implements java.security.interfaces.DSAPublicKey, java.io.Serializable
An X.509 public key for the Digital Signature Algorithm.- Version:
- 1.52, 97/12/10
- Author:
- Benjamin Renaud
- See Also:
DSAPrivateKey
,AlgIdDSA
,DSA
, Serialized Form
-
-
Field Summary
-
Fields inherited from class netscape.security.x509.X509Key
algid, encodedKey, key
-
-
Constructor Summary
Constructors Constructor Description DSAPublicKey()
DSAPublicKey(byte[] encoded)
Make a DSA public key from its DER encoding (X.509).DSAPublicKey(java.math.BigInteger y, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g)
Make a DSA public key out of a public key and three parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.security.interfaces.DSAParams
getParams()
Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.java.math.BigInteger
getY()
Get the raw public value, y, without the parameters.int
hashCode()
Calculates a hash code value for the object.protected void
parseKeyBits()
Parse the key bits.java.lang.String
toString()
-
Methods inherited from class netscape.security.x509.X509Key
decode, decode, encode, encode, getAlgorithm, getAlgorithmId, getEncoded, getFormat, getKey, parse, parsePublicKey
-
-
-
-
Constructor Detail
-
DSAPublicKey
public DSAPublicKey()
-
DSAPublicKey
public DSAPublicKey(java.math.BigInteger y, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g) throws java.security.InvalidKeyException
Make a DSA public key out of a public key and three parameters.- Throws:
java.security.InvalidKeyException
-
DSAPublicKey
public DSAPublicKey(byte[] encoded) throws java.security.InvalidKeyException
Make a DSA public key from its DER encoding (X.509).- Throws:
java.security.InvalidKeyException
-
-
Method Detail
-
getParams
public java.security.interfaces.DSAParams getParams()
Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.- Specified by:
getParams
in interfacejava.security.interfaces.DSAKey
-
getY
public java.math.BigInteger getY()
Get the raw public value, y, without the parameters.- Specified by:
getY
in interfacejava.security.interfaces.DSAPublicKey
-
parseKeyBits
protected void parseKeyBits() throws java.security.InvalidKeyException
Description copied from class:X509Key
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 thekey
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
anddecode
.- Overrides:
parseKeyBits
in classX509Key
- Throws:
java.security.InvalidKeyException
- on invalid key encodings.
-
hashCode
public int hashCode()
Description copied from class:X509Key
Calculates a hash code value for the object. Objects which are equal will also have the same hashcode.
-
-