All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.provider.rsa.BaseRSAPrivateKey

java.lang.Object
   |
   +----cryptix.provider.rsa.BaseRSAPrivateKey

public abstract class BaseRSAPrivateKey
extends Object
implements RSAPrivateKey, RSAFactors
An abstract class representing an RSA private key.

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

$Revision: 1.5 $

Author:
Raif S. Naffah, David Hopwood

Constructor Index

 o BaseRSAPrivateKey()
Constructs an RSA private key, without setting the parameters.

Method Index

 o getAlgorithm()
Returns the name of the algorithm, for this class always "RSA".
 o getEncoded()
 o getExponent()
Return the private exponent d.
 o getFormat()
 o getInverseOfQModP()
Returns the multiplicative inverse of q modulo p.
 o getModulus()
Return the public modulus n: the product of both p and q.
 o getP()
Returns p, the first factor of the public modulus.
 o getQ()
Return q, the second factor of the public modulus.
 o setRsaParams(BigInteger, BigInteger)
Sets the RSA parameters n and d.
 o setRsaParams(BigInteger, BigInteger, BigInteger, BigInteger)
Sets the RSA parameters d, p, q, and u, to allow fast execution of mathematical operations performed later on during the life of this key.
 o toString()
Returns a string representation of this key.

Constructors

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

Methods

 o getModulus
 public BigInteger getModulus()
Return the public modulus n: the product of both p and q.

Returns:
the public modulus n: the product of both p and q.
 o getExponent
 public BigInteger getExponent()
Return the private exponent d.

Returns:
the private exponent d.
 o getP
 public BigInteger getP()
Returns p, the first factor of the public modulus.

Returns:
the first factor p
 o getQ
 public BigInteger getQ()
Return q, the second factor of the public modulus.

Returns:
the second factor q
 o getInverseOfQModP
 public BigInteger getInverseOfQModP()
Returns the multiplicative inverse of q modulo p. The values p and q are those returned by the getP() and getQ() methods respectively.

Returns:
the multiplicative inverse of q modulo p.
 o getAlgorithm
 public String getAlgorithm()
Returns the name of the algorithm, for this class always "RSA".

Returns:
the name of the algorithm, "RSA".
 o setRsaParams
 protected void setRsaParams(BigInteger n,
                             BigInteger d)
Sets the RSA parameters n and d.

Throws: NullPointerException
if n == null || d == null
 o setRsaParams
 protected void setRsaParams(BigInteger d,
                             BigInteger p,
                             BigInteger q,
                             BigInteger u)
Sets the RSA parameters d, p, q, and u, to allow fast execution of mathematical operations performed later on during the life of this key. u may be null, in which case it is calculated automatically.

Throws: NullPointerException
if d == null || p == null || q == null
Throws: InvalidParameterException
if u must be calculated, and gcd(q, p) != 1
 o toString
 public String toString()
Returns a string representation of this key. This may reveal private information when debugging is enabled, and should be used with care.

Returns:
a string representation of this key.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index