public class DSSPublicKey extends DSSKey implements java.security.PublicKey, java.security.interfaces.DSAPublicKey
An object that embodies a DSS (Digital Signature Standard) public key.
getEncoded(int)
,
Serialized FormConstructor and Description |
---|
DSSPublicKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger y)
Trivial constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns
true if the designated object is an instance of
DSAPublicKey and has the same DSS (Digital Signature Standard)
parameter values as this one. |
byte[] |
getEncoded(int format)
Returns the encoded form of this public key according to the designated
format.
|
java.math.BigInteger |
getY() |
static DSSPublicKey |
valueOf(byte[] k)
A class method that takes the output of the
encodePublicKey()
method of a DSS keypair codec object (an instance implementing
IKeyPairCodec for DSS keys, and re-constructs an
instance of this object. |
getAlgorithm, getEncoded, getFormat, getParams
public DSSPublicKey(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger y)
Trivial constructor.
p
- the public modulus.q
- the public prime divisor of p-1
.g
- a generator of the unique cyclic group Z*
p
.y
- the public key part.public static DSSPublicKey valueOf(byte[] k)
A class method that takes the output of the encodePublicKey()
method of a DSS keypair codec object (an instance implementing
IKeyPairCodec
for DSS keys, and re-constructs an
instance of this object.
k
- the contents of a previously encoded instance of this object.java.lang.ArrayIndexOutOfBoundsException
- if there is not enough bytes,
in k
, to represent a valid encoding of an instance of
this object.java.lang.IllegalArgumentException
- if the byte sequence does not
represent a valid encoding of an instance of this object.public java.math.BigInteger getY()
getY
in interface java.security.interfaces.DSAPublicKey
public byte[] getEncoded(int format)
Returns the encoded form of this public key according to the designated format.
getEncoded
in class DSSKey
format
- the desired format identifier of the resulting encoding.java.lang.IllegalArgumentException
- if the format is not supported.DSSKeyPairRawCodec
public boolean equals(java.lang.Object obj)
Returns true
if the designated object is an instance of
DSAPublicKey
and has the same DSS (Digital Signature Standard)
parameter values as this one.
Copyright © 2025. All rights reserved.