gnu.crypto.key.dss

Class DSSPublicKey

public class DSSPublicKey extends DSSKey implements PublicKey, DSAPublicKey

An object that embodies a DSS (Digital Signature Standard) public key.

Version: $Revision: 1.2 $

See Also: DSSPublicKey

Constructor Summary
DSSPublicKey(BigInteger p, BigInteger q, BigInteger g, BigInteger y)

Trivial constructor.

Method Summary
booleanequals(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.

BigIntegergetY()
static DSSPublicKeyvalueOf(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.

Constructor Detail

DSSPublicKey

public DSSPublicKey(BigInteger p, BigInteger q, BigInteger g, BigInteger y)

Trivial constructor.

Parameters: 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.

Method Detail

equals

public boolean equals(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.

Parameters: obj the other non-null DSS key to compare to.

Returns: true if the designated object is of the same type and value as this one.

getEncoded

public byte[] getEncoded(int format)

Returns the encoded form of this public key according to the designated format.

Parameters: format the desired format identifier of the resulting encoding.

Returns: the byte sequence encoding this key according to the designated format.

Throws: IllegalArgumentException if the format is not supported.

See Also: DSSKeyPairRawCodec

getY

public BigInteger getY()

valueOf

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.

Parameters: k the contents of a previously encoded instance of this object.

Throws: ArrayIndexOutOfBoundsException if there is not enough bytes, in k, to represent a valid encoding of an instance of this object. IllegalArgumentException if the byte sequence does not represent a valid encoding of an instance of this object.

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.