For the latest news and information visit
The GNU Crypto project

gnu.crypto.sig.rsa
Class GnuRSAPublicKey

java.lang.Object
  |
  +--gnu.crypto.sig.rsa.GnuRSAKey
        |
        +--gnu.crypto.sig.rsa.GnuRSAPublicKey
All Implemented Interfaces:
java.security.Key, java.security.PublicKey, java.security.interfaces.RSAKey, java.security.interfaces.RSAPublicKey, java.io.Serializable

public class GnuRSAPublicKey
extends GnuRSAKey
implements java.security.PublicKey, java.security.interfaces.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 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface java.security.PublicKey
serialVersionUID
 
Constructor Summary
GnuRSAPublicKey(java.math.BigInteger n, java.math.BigInteger e)
          Trivial constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the designated object is an instance of this class and has the same DSS (Digital Signature Standard) parameter values as this one.
 byte[] getEncoded()
          Deprecated. see getEncoded(int).
 byte[] getEncoded(int format)
          Returns the encoded form of this public key according to the designated format.
 java.math.BigInteger getPublicExponent()
           
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.
 
Methods inherited from class gnu.crypto.sig.rsa.GnuRSAKey
getAlgorithm, getFormat, getModulus, getN
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Key
getAlgorithm, getFormat
 
Methods inherited from interface java.security.interfaces.RSAKey
getModulus
 

Constructor Detail

GnuRSAPublicKey

public GnuRSAPublicKey(java.math.BigInteger n,
                       java.math.BigInteger e)

Trivial constructor.

Parameters:
n - the modulus.
e - the public exponent.
Method Detail

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

getPublicExponent

public java.math.BigInteger getPublicExponent()
Specified by:
getPublicExponent in interface java.security.interfaces.RSAPublicKey

getEncoded

public byte[] getEncoded()
Deprecated. see getEncoded(int).

Specified by:
getEncoded in interface java.security.Key

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:
java.lang.IllegalArgumentException - if the format is not supported.
See Also:
DSSKeyPairRawCodec

equals

public boolean equals(java.lang.Object obj)
Returns true if the designated object is an instance of this class and has the same DSS (Digital Signature Standard) parameter values as this one.

Overrides:
equals in class GnuRSAKey
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.

For the latest news and information visit
The GNU Crypto project

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