Class DSAPublicKey
- java.lang.Object
-
- org.mozilla.jss.netscape.security.x509.X509Key
-
- org.mozilla.jss.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.- See Also:
DSAPrivateKey,AlgIdDSA, Serialized Form
-
-
Field Summary
-
Fields inherited from class org.mozilla.jss.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 booleanequals(java.lang.Object obj)java.security.interfaces.DSAParamsgetParams()Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.java.math.BigIntegergetY()Get the raw public value, y, without the parameters.inthashCode()Calculates a hash code value for the object.protected voidparseKeyBits()Parse the key bits.java.lang.StringtoString()-
Methods inherited from class org.mozilla.jss.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.InvalidKeyExceptionMake a DSA public key out of a public key and three parameters.- Throws:
java.security.InvalidKeyException
-
DSAPublicKey
public DSAPublicKey(byte[] encoded) throws java.security.InvalidKeyExceptionMake 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:
getParamsin interfacejava.security.interfaces.DSAKey
-
getY
public java.math.BigInteger getY()
Get the raw public value, y, without the parameters.- Specified by:
getYin interfacejava.security.interfaces.DSAPublicKey
-
parseKeyBits
protected void parseKeyBits() throws java.security.InvalidKeyExceptionDescription copied from class:X509KeyParse 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 thekeybits; 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
parseanddecode.- Overrides:
parseKeyBitsin classX509Key- Throws:
java.security.InvalidKeyException- on invalid key encodings.
-
hashCode
public int hashCode()
Description copied from class:X509KeyCalculates a hash code value for the object. Objects which are equal will also have the same hashcode.
-
-