public abstract class BaseRSAPrivateKey extends java.lang.Object implements CryptixRSAPrivateKey, RSAFactors
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.7 $
Modifier | Constructor and Description |
---|---|
protected |
BaseRSAPrivateKey()
Constructs an RSA private key, without setting the parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlgorithm()
Returns the name of the algorithm, for this class always "RSA".
|
java.math.BigInteger |
getExponent()
Return the private exponent d.
|
java.math.BigInteger |
getInverseOfQModP()
Returns the multiplicative inverse of q modulo p.
|
java.math.BigInteger |
getModulus()
Return the public modulus n: the product of both p
and q.
|
java.math.BigInteger |
getP()
Returns p, the first factor of the public modulus.
|
java.math.BigInteger |
getQ()
Return q, the second factor of the public modulus.
|
protected void |
setRsaParams(java.math.BigInteger n,
java.math.BigInteger d)
Sets the RSA parameters n and d.
|
protected void |
setRsaParams(java.math.BigInteger d,
java.math.BigInteger p,
java.math.BigInteger q,
java.math.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.
|
java.lang.String |
toString()
Returns a string representation of this key.
|
protected BaseRSAPrivateKey()
public java.math.BigInteger getModulus()
getModulus
in interface RSAKey
public java.math.BigInteger getExponent()
getExponent
in interface RSAKey
public java.math.BigInteger getP()
getP
in interface RSAFactors
public java.math.BigInteger getQ()
getQ
in interface RSAFactors
public java.math.BigInteger getInverseOfQModP()
getInverseOfQModP
in interface RSAFactors
public java.lang.String getAlgorithm()
getAlgorithm
in interface java.security.Key
protected void setRsaParams(java.math.BigInteger n, java.math.BigInteger d)
java.lang.NullPointerException
- if n == null || d == nullprotected void setRsaParams(java.math.BigInteger d, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger u)
java.lang.NullPointerException
- if d == null || p == null || q == nulljava.security.InvalidParameterException
- if u must be calculated, and
gcd(q, p) != 1public java.lang.String toString()
toString
in class java.lang.Object