cryptix.provider.rsa
Class BaseRSAPrivateKey
java.lang.Object
cryptix.provider.rsa.BaseRSAPrivateKey
- CryptixRSAPrivateKey, PrivateKey, RSAFactors, RSAKey
public abstract class BaseRSAPrivateKey
extends java.lang.Object
- Raif S. Naffah
- David Hopwood
- Cryptix 2.2.2
String | getAlgorithm() - Returns the name of the algorithm, for this class always "RSA".
|
BigInteger | getExponent() - Return the private exponent d.
|
BigInteger | getInverseOfQModP() - Returns the multiplicative inverse of q modulo p.
|
BigInteger | getModulus() - Return the public modulus n: the product of both p
and q.
|
BigInteger | getP() - Returns p, the first factor of the public modulus.
|
BigInteger | getQ() - Return q, the second factor of the public modulus.
|
protected void | setRsaParams(BigInteger n, BigInteger d) - Sets the RSA parameters n and d.
|
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.
|
String | 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.
getAlgorithm
public String getAlgorithm()
Returns the name of the algorithm, for this class always "RSA".
- the name of the algorithm, "RSA".
getExponent
public BigInteger getExponent()
Return the private exponent d.
- getExponent in interface RSAKey
- the private exponent d.
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.
- getInverseOfQModP in interface RSAFactors
- the multiplicative inverse of q modulo p.
getModulus
public BigInteger getModulus()
Return the public modulus n: the product of both p
and q.
- getModulus in interface RSAKey
- the public modulus n: the product of both p
and q.
getP
public BigInteger getP()
Returns p, the first factor of the public modulus.
- getP in interface RSAFactors
- the first factor p
getQ
public BigInteger getQ()
Return q, the second factor of the public modulus.
- getQ in interface RSAFactors
- the second factor q
setRsaParams
protected void setRsaParams(BigInteger n,
BigInteger d)
Sets the RSA parameters n and d.
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.
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.
- a string representation of this key.