Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.java.security.key.rsa
Class GnuRSAPublicKey  view GnuRSAPublicKey download GnuRSAPublicKey.java

java.lang.Object
  extended bygnu.java.security.key.rsa.GnuRSAKey
      extended bygnu.java.security.key.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.


Field Summary
private  java.lang.String str
          String representation of this key.
 
Fields inherited from class gnu.java.security.key.rsa.GnuRSAKey
defaultFormat
 
Fields inherited from interface java.security.PublicKey
serialVersionUID
 
Fields inherited from interface java.security.interfaces.RSAPublicKey
serialVersionUID
 
Constructor Summary
GnuRSAPublicKey(java.math.BigInteger n, java.math.BigInteger e)
          Conveience constructor.
GnuRSAPublicKey(int preferredFormat, java.math.BigInteger n, java.math.BigInteger e)
          Constructs a new instance of GnuRSAPublicKey given the designated arguments.
 
Method Summary
 boolean equals(java.lang.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.
 java.lang.String toString()
          Convert this Object to a human-readable String.
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 gnu.java.security.key.IKeyPairCodec for RSA keys, and re-constructs an instance of this object.
 
Methods inherited from class gnu.java.security.key.rsa.GnuRSAKey
getAlgorithm, getE, getEncoded, getFormat, getModulus, getN, getPublicExponent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
 
Methods inherited from interface java.security.interfaces.RSAPublicKey
getPublicExponent
 
Methods inherited from interface java.security.interfaces.RSAKey
getModulus
 

Field Detail

str

private transient java.lang.String str
String representation of this key. Cached for speed.

Constructor Detail

GnuRSAPublicKey

public GnuRSAPublicKey(java.math.BigInteger n,
                       java.math.BigInteger e)
Conveience constructor. Calls the constructor with 3 arguments passing Registry.RAW_ENCODING_ID>Registry.RAW_ENCODING_ID 55 as the identifier of the preferred encoding format.


GnuRSAPublicKey

public GnuRSAPublicKey(int preferredFormat,
                       java.math.BigInteger n,
                       java.math.BigInteger e)
Constructs a new instance of GnuRSAPublicKey given the designated arguments.

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 gnu.java.security.key.IKeyPairCodec for RSA keys, and re-constructs an instance of this object.


getEncoded

public byte[] getEncoded(int format)

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

Specified by:
getEncoded in class GnuRSAKey

equals

public boolean equals(java.lang.Object obj)

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

Overrides:
equals in class GnuRSAKey

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).

Overrides:
toString in class GnuRSAKey