RSAMultiPrimePrivateCrtKeySpecpublic class RSAMultiPrimePrivateCrtKeySpec extends RSAPrivateKeySpec The key specification of a RSA multi-prime private key with the Chinese
Remainder Theorem (CRT) information values used.
Defined in the PKCS #1 v2.1
standard.
|
Fields Summary |
---|
private final BigInteger | publicExponent | private final BigInteger | primeP | private final BigInteger | primeQ | private final BigInteger | primeExponentP | private final BigInteger | primeExponentQ | private final BigInteger | crtCoefficient | private final RSAOtherPrimeInfo[] | otherPrimeInfo |
Constructors Summary |
---|
public RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient, RSAOtherPrimeInfo[] otherPrimeInfo)Creates a new {@code RSAMultiPrimePrivateCrtKeySpec} with the specified
modulus, public exponent, private exponent, prime factors, prime
exponents, crt coefficient, and additional primes.
super(modulus, privateExponent);
// Perform checks specified
if (modulus == null) {
throw new NullPointerException(Messages.getString("security.83", "modulus")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (privateExponent == null) {
throw new NullPointerException(Messages.getString("security.83", "privateExponent")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (publicExponent == null) {
throw new NullPointerException(Messages.getString("security.83", "publicExponent")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (primeP == null) {
throw new NullPointerException(Messages.getString("security.83", "primeP")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (primeQ == null) {
throw new NullPointerException(Messages.getString("security.83", "primeQ")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (primeExponentP == null) {
throw new NullPointerException(Messages.getString("security.83", "primeExponentP")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (primeExponentQ == null) {
throw new NullPointerException(Messages.getString("security.83", "primeExponentQ")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (crtCoefficient == null) {
throw new NullPointerException(Messages.getString("security.83", "crtCoefficient")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (otherPrimeInfo != null) {
if (otherPrimeInfo.length == 0) {
throw new IllegalArgumentException(
Messages.getString("security.85")); //$NON-NLS-1$
}
// Clone array to prevent subsequent modification
this.otherPrimeInfo = new RSAOtherPrimeInfo[otherPrimeInfo.length];
System.arraycopy(otherPrimeInfo, 0,
this.otherPrimeInfo, 0, this.otherPrimeInfo.length);
} else {
this.otherPrimeInfo = null;
}
this.publicExponent = publicExponent;
this.primeP = primeP;
this.primeQ = primeQ;
this.primeExponentP = primeExponentP;
this.primeExponentQ = primeExponentQ;
this.crtCoefficient = crtCoefficient;
|
Methods Summary |
---|
public java.math.BigInteger | getCrtCoefficient()Returns the CRT coefficient, {@code q^-1 mod p}.
return crtCoefficient;
| public java.security.spec.RSAOtherPrimeInfo[] | getOtherPrimeInfo()Returns the information for the additional primes.
// Clone array (if not null) to prevent subsequent modification
if (otherPrimeInfo == null) {
return null;
} else {
RSAOtherPrimeInfo[] ret =
new RSAOtherPrimeInfo[otherPrimeInfo.length];
System.arraycopy(otherPrimeInfo, 0, ret, 0, ret.length);
return ret;
}
| public java.math.BigInteger | getPrimeExponentP()Returns the exponent of the prime {@code p}.
return primeExponentP;
| public java.math.BigInteger | getPrimeExponentQ()Returns the exponent of the prime {@code q}.
return primeExponentQ;
| public java.math.BigInteger | getPrimeP()Returns the prime factor {@code p}.
return primeP;
| public java.math.BigInteger | getPrimeQ()Returns the prime factor {@code q}.
return primeQ;
| public java.math.BigInteger | getPublicExponent()Returns the public exponent {@code e}.
return publicExponent;
|
|