gnu.crypto.key.rsa

Class GnuRSAPublicKey

public class GnuRSAPublicKey extends GnuRSAKey implements PublicKey, RSAPublicKey

An object that encapsulates an RSA public key.

References:

  1. RSA-PSS Signature Scheme with Appendix, part B.
    Primitive specification and supporting documentation.
    Jakob Jonsson and Burt Kaliski.

Version: $Revision: 1.3 $

Constructor Summary
GnuRSAPublicKey(BigInteger n, BigInteger e)

Trivial constructor.

Method Summary
booleanequals(Object obj)

Returns true if the designated object is an instance of this class and has the same RSA parameter values as this one.

byte[]getEncoded(int format)

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

static GnuRSAPublicKeyvalueOf(byte[] k)

A class method that takes the output of the encodePublicKey() method of an RSA keypair codec object (an instance implementing IKeyPairCodec for RSA keys, and re-constructs an instance of this object.

Constructor Detail

GnuRSAPublicKey

public GnuRSAPublicKey(BigInteger n, BigInteger e)

Trivial constructor.

Parameters: n the modulus. e the public exponent.

Method Detail

equals

public boolean equals(Object obj)

Returns true if the designated object is an instance of this class and has the same RSA parameter values as this one.

Parameters: obj the other non-null RSA 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: RSAKeyPairRawCodec

valueOf

public static GnuRSAPublicKey valueOf(byte[] k)

A class method that takes the output of the encodePublicKey() method of an RSA keypair codec object (an instance implementing IKeyPairCodec for RSA 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.