cryptix.provider.rsa
Class BaseRSAPublicKey

java.lang.Object
  |
  +--cryptix.provider.rsa.BaseRSAPublicKey
All Implemented Interfaces:
CryptixRSAPublicKey, java.security.Key, java.security.PublicKey, RSAKey, java.io.Serializable
Direct Known Subclasses:
RawRSAPublicKey

public abstract class BaseRSAPublicKey
extends java.lang.Object
implements CryptixRSAPublicKey

An abstract class representing an RSA public key.

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.6 $

Since:
Cryptix 2.2.2
Author:
Raif S. Naffah, David Hopwood
See Also:
Serialized Form

Fields inherited from interface java.security.PublicKey
serialVersionUID
 
Constructor Summary
protected BaseRSAPublicKey()
          Constructs an RSA private key, without setting the parameters.
 
Method Summary
 java.lang.String getAlgorithm()
          Returns the name of the algorithm, for this class always "RSA".
 java.math.BigInteger getExponent()
          Returns the public exponent e.
 java.math.BigInteger getModulus()
          Returns the public modulus n.
protected  void setRsaParams(java.math.BigInteger n, java.math.BigInteger e)
          Sets the RSA parameters n and e.
 java.lang.String toString()
          Returns a string representation of this key.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Key
getEncoded, getFormat
 

Constructor Detail

BaseRSAPublicKey

protected BaseRSAPublicKey()
Constructs an RSA private key, without setting the parameters. Subclasses should call one of the setRsaParams methods in each of their constructors.
Method Detail

getModulus

public java.math.BigInteger getModulus()
Returns the public modulus n.
Specified by:
getModulus in interface RSAKey
Returns:
the public modulus n.

getExponent

public java.math.BigInteger getExponent()
Returns the public exponent e.
Specified by:
getExponent in interface RSAKey
Returns:
the public exponent e.

getAlgorithm

public java.lang.String getAlgorithm()
Returns the name of the algorithm, for this class always "RSA".
Specified by:
getAlgorithm in interface java.security.Key
Returns:
the name of the algorithm, "RSA".

setRsaParams

protected void setRsaParams(java.math.BigInteger n,
                            java.math.BigInteger e)
Sets the RSA parameters n and e.
Throws:
NullPointerException - if n == null || e == null

toString

public java.lang.String toString()
Returns a string representation of this key.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this key.