Top Description Fields Constructors Methods
java.security.spec

public Class RSAMultiPrimePrivateCrtKeySpec

extends RSAPrivateKeySpec
Class Inheritance
Imports
java.math.BigInteger, java.util.Objects

This class specifies an RSA multi-prime private key, as defined in the PKCS#1 v2.2 standard using the Chinese Remainder Theorem (CRT) information values for efficiency.
Author
Valerie Peng
Since
1.4
See Also
java.security.Key, java.security.KeyFactory, KeySpec, PKCS8EncodedKeySpec, RSAPrivateKeySpec, RSAPublicKeySpec, RSAOtherPrimeInfo

Field Summary

Modifier and TypeField and Description
private final BigInteger
private final RSAOtherPrimeInfo[]
private final BigInteger
private final BigInteger
private final BigInteger
private final BigInteger
private final BigInteger

Constructor Summary

AccessConstructor and Description
public
RSAMultiPrimePrivateCrtKeySpec(BigInteger
the modulus n
modulus
,
BigInteger
the public exponent e
publicExponent
,
BigInteger
the private exponent d
privateExponent
,
BigInteger
the prime factor p of n
primeP
,
BigInteger
the prime factor q of n
primeQ
,
BigInteger
this is d mod (p-1)
primeExponentP
,
BigInteger
this is d mod (q-1)
primeExponentQ
,
BigInteger
the Chinese Remainder Theorem coefficient q-1 mod p
crtCoefficient
,
RSAOtherPrimeInfo[]
triplets of the rest of primes, null can be specified if there are only two prime factors (p and q)
otherPrimeInfo
)

Creates a new RSAMultiPrimePrivateCrtKeySpec.

public
RSAMultiPrimePrivateCrtKeySpec(BigInteger
the modulus n
modulus
,
BigInteger
the public exponent e
publicExponent
,
BigInteger
the private exponent d
privateExponent
,
BigInteger
the prime factor p of n
primeP
,
BigInteger
the prime factor q of n
primeQ
,
BigInteger
this is d mod (p-1)
primeExponentP
,
BigInteger
this is d mod (q-1)
primeExponentQ
,
BigInteger
the Chinese Remainder Theorem coefficient q-1 mod p
crtCoefficient
,
RSAOtherPrimeInfo[]
triplets of the rest of primes, null can be specified if there are only two prime factors (p and q)
otherPrimeInfo
,
AlgorithmParameterSpec
the parameters associated with key
keyParams
)

Creates a new RSAMultiPrimePrivateCrtKeySpec with additional key parameters.

Method Summary

Modifier and TypeMethod and Description
public BigInteger

Returns:

the crtCoefficient.
getCrtCoefficient
()

Returns the crtCoefficient.

public RSAOtherPrimeInfo[]

Returns:

the otherPrimeInfo. Returns a new array each time this method is called.
getOtherPrimeInfo
()

Returns a copy of the otherPrimeInfo or null if there are only two prime factors (p and q).

public BigInteger

Returns:

the primeExponentP.
getPrimeExponentP
()

Returns the primeExponentP.

public BigInteger

Returns:

the primeExponentQ.
getPrimeExponentQ
()

Returns the primeExponentQ.

public BigInteger

Returns:

the primeP.
getPrimeP
()

Returns the primeP.

public BigInteger

Returns:

the primeQ.
getPrimeQ
()

Returns the primeQ.

public BigInteger

Returns:

the public exponent.
getPublicExponent
()

Returns the public exponent.

Inherited from java.security.spec.RSAPrivateKeySpec:
getModulusgetParamsgetPrivateExponent

Field Detail

crtCoefficientback to summary
private final BigInteger crtCoefficient
otherPrimeInfoback to summary
private final RSAOtherPrimeInfo[] otherPrimeInfo
primeExponentPback to summary
private final BigInteger primeExponentP
primeExponentQback to summary
private final BigInteger primeExponentQ
primePback to summary
private final BigInteger primeP
primeQback to summary
private final BigInteger primeQ
publicExponentback to summary
private final BigInteger publicExponent

Constructor Detail

RSAMultiPrimePrivateCrtKeySpecback to summary
public RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient, RSAOtherPrimeInfo[] otherPrimeInfo)

Creates a new RSAMultiPrimePrivateCrtKeySpec.

Note that the contents of otherPrimeInfo are copied to protect against subsequent modification when constructing this object.

Parameters
modulus:BigInteger

the modulus n

publicExponent:BigInteger

the public exponent e

privateExponent:BigInteger

the private exponent d

primeP:BigInteger

the prime factor p of n

primeQ:BigInteger

the prime factor q of n

primeExponentP:BigInteger

this is d mod (p-1)

primeExponentQ:BigInteger

this is d mod (q-1)

crtCoefficient:BigInteger

the Chinese Remainder Theorem coefficient q-1 mod p

otherPrimeInfo:RSAOtherPrimeInfo[]

triplets of the rest of primes, null can be specified if there are only two prime factors (p and q)

Exceptions
NullPointerException:
if any of the specified parameters except otherPrimeInfo is null
IllegalArgumentException:
if an empty, i.e. 0-length, otherPrimeInfo is specified
RSAMultiPrimePrivateCrtKeySpecback to summary
public RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient, RSAOtherPrimeInfo[] otherPrimeInfo, AlgorithmParameterSpec keyParams)

Creates a new RSAMultiPrimePrivateCrtKeySpec with additional key parameters.

Note that the contents of otherPrimeInfo are copied to protect against subsequent modification when constructing this object.

Parameters
modulus:BigInteger

the modulus n

publicExponent:BigInteger

the public exponent e

privateExponent:BigInteger

the private exponent d

primeP:BigInteger

the prime factor p of n

primeQ:BigInteger

the prime factor q of n

primeExponentP:BigInteger

this is d mod (p-1)

primeExponentQ:BigInteger

this is d mod (q-1)

crtCoefficient:BigInteger

the Chinese Remainder Theorem coefficient q-1 mod p

otherPrimeInfo:RSAOtherPrimeInfo[]

triplets of the rest of primes, null can be specified if there are only two prime factors (p and q)

keyParams:AlgorithmParameterSpec

the parameters associated with key

Exceptions
NullPointerException:
if any of the specified parameters except otherPrimeInfo and keyParams is null
IllegalArgumentException:
if an empty, i.e. 0-length, otherPrimeInfo is specified
Since
11

Method Detail

getCrtCoefficientback to summary
public BigInteger getCrtCoefficient()

Returns the crtCoefficient.

Returns:BigInteger

the crtCoefficient.

getOtherPrimeInfoback to summary
public RSAOtherPrimeInfo[] getOtherPrimeInfo()

Returns a copy of the otherPrimeInfo or null if there are only two prime factors (p and q).

Returns:RSAOtherPrimeInfo[]

the otherPrimeInfo. Returns a new array each time this method is called.

getPrimeExponentPback to summary
public BigInteger getPrimeExponentP()

Returns the primeExponentP.

Returns:BigInteger

the primeExponentP.

getPrimeExponentQback to summary
public BigInteger getPrimeExponentQ()

Returns the primeExponentQ.

Returns:BigInteger

the primeExponentQ.

getPrimePback to summary
public BigInteger getPrimeP()

Returns the primeP.

Returns:BigInteger

the primeP.

getPrimeQback to summary
public BigInteger getPrimeQ()

Returns the primeQ.

Returns:BigInteger

the primeQ.

getPublicExponentback to summary
public BigInteger getPublicExponent()

Returns the public exponent.

Returns:BigInteger

the public exponent.