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
-
BaseRSAPrivateKey()
- Constructs an RSA private key, without setting the parameters.
-
getAlgorithm()
- Returns the name of the algorithm, for this class always "RSA".
-
getEncoded()
-
-
getExponent()
- Return the private exponent d.
-
getFormat()
-
-
getInverseOfQModP()
- Returns the multiplicative inverse of q modulo p.
-
getModulus()
- Return the public modulus n: the product of both p
and q.
-
getP()
- Returns p, the first factor of the public modulus.
-
getQ()
- Return q, the second factor of the public modulus.
-
setRsaParams(BigInteger, BigInteger)
- Sets the RSA parameters n and d.
-
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.
-
toString()
- Returns a string representation of this key.
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.
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.
getExponent
public BigInteger getExponent()
- Return the private exponent d.
- Returns:
- the private exponent d.
getP
public BigInteger getP()
- Returns p, the first factor of the public modulus.
- Returns:
- the first factor p
getQ
public BigInteger getQ()
- Return q, the second factor of the public modulus.
- Returns:
- the second factor q
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.
getAlgorithm
public String getAlgorithm()
- Returns the name of the algorithm, for this class always "RSA".
- Returns:
- the name of the algorithm, "RSA".
setRsaParams
protected void setRsaParams(BigInteger n,
BigInteger d)
- Sets the RSA parameters n and d.
- Throws: NullPointerException
- if n == null || d == null
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
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