java.security.spec
Class RSAMultiPrimePrivateCrtKeySpec

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.spec.RSAPrivateKeySpec sample code for java.security.spec.RSAPrivateKeySpec definition code for java.security.spec.RSAPrivateKeySpec 
      extended by java.security.spec.RSAMultiPrimePrivateCrtKeySpec
All Implemented Interfaces:
KeySpec sample code for java.security.spec.KeySpec definition code for java.security.spec.KeySpec

public class RSAMultiPrimePrivateCrtKeySpec
extends RSAPrivateKeySpec sample code for java.security.spec.RSAPrivateKeySpec definition code for java.security.spec.RSAPrivateKeySpec

This class specifies an RSA multi-prime private key, as defined in the PKCS#1 v2.1, using the Chinese Remainder Theorem (CRT) information values for efficiency.

Since:
1.4
See Also:
Key sample code for java.security.Key definition code for java.security.Key , KeyFactory sample code for java.security.KeyFactory definition code for java.security.KeyFactory , KeySpec sample code for java.security.spec.KeySpec definition code for java.security.spec.KeySpec , PKCS8EncodedKeySpec sample code for java.security.spec.PKCS8EncodedKeySpec definition code for java.security.spec.PKCS8EncodedKeySpec , RSAPrivateKeySpec sample code for java.security.spec.RSAPrivateKeySpec definition code for java.security.spec.RSAPrivateKeySpec , RSAPublicKeySpec sample code for java.security.spec.RSAPublicKeySpec definition code for java.security.spec.RSAPublicKeySpec , RSAOtherPrimeInfo sample code for java.security.spec.RSAOtherPrimeInfo definition code for java.security.spec.RSAOtherPrimeInfo

Constructor Summary
RSAMultiPrimePrivateCrtKeySpec sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.RSAMultiPrimePrivateCrtKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.security.spec.RSAOtherPrimeInfo[]) definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.RSAMultiPrimePrivateCrtKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.security.spec.RSAOtherPrimeInfo[]) (BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  modulus, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  publicExponent, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  privateExponent, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  primeP, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  primeQ, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  primeExponentP, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  primeExponentQ, BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  crtCoefficient, RSAOtherPrimeInfo sample code for java.security.spec.RSAOtherPrimeInfo definition code for java.security.spec.RSAOtherPrimeInfo [] otherPrimeInfo)
          Creates a new RSAMultiPrimePrivateCrtKeySpec given the modulus, publicExponent, privateExponent, primeP, primeQ, primeExponentP, primeExponentQ, crtCoefficient, and otherPrimeInfo as defined in PKCS#1 v2.1.
 
Method Summary
 BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger getCrtCoefficient sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getCrtCoefficient() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getCrtCoefficient() ()
          Returns the crtCoefficient.
 RSAOtherPrimeInfo sample code for java.security.spec.RSAOtherPrimeInfo definition code for java.security.spec.RSAOtherPrimeInfo [] getOtherPrimeInfo sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getOtherPrimeInfo() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getOtherPrimeInfo() ()
          Returns a copy of the otherPrimeInfo or null if there are only two prime factors (p and q).
 BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger getPrimeExponentP sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeExponentP() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeExponentP() ()
          Returns the primeExponentP.
 BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger getPrimeExponentQ sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeExponentQ() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeExponentQ() ()
          Returns the primeExponentQ.
 BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger getPrimeP sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeP() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeP() ()
          Returns the primeP.
 BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger getPrimeQ sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeQ() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeQ() ()
          Returns the primeQ.
 BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger getPublicExponent sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPublicExponent() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPublicExponent() ()
          Returns the public exponent.
 
Methods inherited from class java.security.spec.RSAPrivateKeySpec sample code for java.security.spec.RSAPrivateKeySpec definition code for java.security.spec.RSAPrivateKeySpec
getModulus sample code for java.security.spec.RSAPrivateKeySpec.getModulus() definition code for java.security.spec.RSAPrivateKeySpec.getModulus() , getPrivateExponent sample code for java.security.spec.RSAPrivateKeySpec.getPrivateExponent() definition code for java.security.spec.RSAPrivateKeySpec.getPrivateExponent()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

RSAMultiPrimePrivateCrtKeySpec sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.security.spec.RSAOtherPrimeInfo[]) definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec(java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.security.spec.RSAOtherPrimeInfo[])

public RSAMultiPrimePrivateCrtKeySpec(BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  modulus,
                                      BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  publicExponent,
                                      BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  privateExponent,
                                      BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  primeP,
                                      BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  primeQ,
                                      BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  primeExponentP,
                                      BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  primeExponentQ,
                                      BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  crtCoefficient,
                                      RSAOtherPrimeInfo sample code for java.security.spec.RSAOtherPrimeInfo definition code for java.security.spec.RSAOtherPrimeInfo [] otherPrimeInfo)
Creates a new RSAMultiPrimePrivateCrtKeySpec given the modulus, publicExponent, privateExponent, primeP, primeQ, primeExponentP, primeExponentQ, crtCoefficient, and otherPrimeInfo as defined in PKCS#1 v2.1.

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

Parameters:
modulus - the modulus n.
publicExponent - the public exponent e.
privateExponent - the private exponent d.
primeP - the prime factor p of n.
primeQ - the prime factor q of n.
primeExponentP - this is d mod (p-1).
primeExponentQ - this is d mod (q-1).
crtCoefficient - the Chinese Remainder Theorem coefficient q-1 mod p.
otherPrimeInfo - triplets of the rest of primes, null can be specified if there are only two prime factors (p and q).
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if any of the parameters, i.e. modulus, publicExponent, privateExponent, primeP, primeQ, primeExponentP, primeExponentQ, crtCoefficient, is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if an empty, i.e. 0-length, otherPrimeInfo is specified.
Method Detail

getPublicExponent sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPublicExponent() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPublicExponent()

public BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  getPublicExponent()
Returns the public exponent.

Returns:
the public exponent.

getPrimeP sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeP() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeP()

public BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  getPrimeP()
Returns the primeP.

Returns:
the primeP.

getPrimeQ sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeQ() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeQ()

public BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  getPrimeQ()
Returns the primeQ.

Returns:
the primeQ.

getPrimeExponentP sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeExponentP() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeExponentP()

public BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  getPrimeExponentP()
Returns the primeExponentP.

Returns:
the primeExponentP.

getPrimeExponentQ sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeExponentQ() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getPrimeExponentQ()

public BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  getPrimeExponentQ()
Returns the primeExponentQ.

Returns:
the primeExponentQ.

getCrtCoefficient sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getCrtCoefficient() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getCrtCoefficient()

public BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger  getCrtCoefficient()
Returns the crtCoefficient.

Returns:
the crtCoefficient.

getOtherPrimeInfo sample code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getOtherPrimeInfo() definition code for java.security.spec.RSAMultiPrimePrivateCrtKeySpec.getOtherPrimeInfo()

public RSAOtherPrimeInfo sample code for java.security.spec.RSAOtherPrimeInfo definition code for java.security.spec.RSAOtherPrimeInfo [] getOtherPrimeInfo()
Returns a copy of the otherPrimeInfo or null if there are only two prime factors (p and q).

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