For the latest news and information visit
The GNU Crypto project

gnu.crypto.key.rsa
Class GnuRSAKey

java.lang.Object
  extended bygnu.crypto.key.rsa.GnuRSAKey
All Implemented Interfaces:
java.security.Key, java.security.interfaces.RSAKey, java.io.Serializable
Direct Known Subclasses:
GnuRSAPrivateKey, GnuRSAPublicKey

public abstract class GnuRSAKey
extends java.lang.Object
implements java.security.Key, java.security.interfaces.RSAKey

A base asbtract class for both public and private RSA keys.

Version:
$Revision: 1.2 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface java.security.Key
serialVersionUID
 
Constructor Summary
protected GnuRSAKey(java.math.BigInteger n, java.math.BigInteger e)
          Trivial protected constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the designated object is an instance of RSAKey and has the same RSA parameter values as this one.
 java.lang.String getAlgorithm()
           
 java.math.BigInteger getE()
          Same as getPublicExponent().
 byte[] getEncoded()
          Deprecated. see getEncoded(int).
abstract  byte[] getEncoded(int format)
           
 java.lang.String getFormat()
           
 java.math.BigInteger getModulus()
           
 java.math.BigInteger getN()
          Returns the modulus n.
 java.math.BigInteger getPublicExponent()
          Returns the public exponent e.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GnuRSAKey

protected GnuRSAKey(java.math.BigInteger n,
                    java.math.BigInteger e)

Trivial protected constructor.

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

getModulus

public java.math.BigInteger getModulus()
Specified by:
getModulus in interface java.security.interfaces.RSAKey

getAlgorithm

public java.lang.String getAlgorithm()
Specified by:
getAlgorithm in interface java.security.Key

getEncoded

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

Specified by:
getEncoded in interface java.security.Key

getFormat

public java.lang.String getFormat()
Specified by:
getFormat in interface java.security.Key

getN

public java.math.BigInteger getN()

Returns the modulus n.

Returns:
the modulus n.

getPublicExponent

public java.math.BigInteger getPublicExponent()

Returns the public exponent e.

Returns:
the public exponent e.

getE

public java.math.BigInteger getE()

Same as getPublicExponent().

Returns:
the public exponent e.

equals

public boolean equals(java.lang.Object obj)

Returns true if the designated object is an instance of RSAKey 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 abstract byte[] getEncoded(int format)

For the latest news and information visit
The GNU Crypto project

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