# RSAMultiPrimePrivateCrtKeySpec

public class **RSAMultiPrimePrivateCrtKeySpec** extends [RSAPrivateKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPrivateKeySpec.html)  
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.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Key.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyFactory.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/KeySpec.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/PKCS8EncodedKeySpec.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPrivateKeySpec.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPublicKeySpec.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAOtherPrimeInfo.html`

### Public Constructor Summary

|---|---|
|   | [RSAMultiPrimePrivateCrtKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html#RSAMultiPrimePrivateCrtKeySpec(java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger,%20java.math.BigInteger,%20java.security.spec.RSAOtherPrimeInfo[]))(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient, [RSAOtherPrimeInfo\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAOtherPrimeInfo.html) otherPrimeInfo) Creates a new `RSAMultiPrimePrivateCrtKeySpec` given the modulus, publicExponent, privateExponent, primeP, primeQ, primeExponentP, primeExponentQ, crtCoefficient, and otherPrimeInfo as defined in PKCS#1 v2.1. |

### Public Method Summary

|---|---|
| BigInteger | [getCrtCoefficient](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html#getCrtCoefficient())() Returns the crtCoefficient. |
| [RSAOtherPrimeInfo\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAOtherPrimeInfo.html) | [getOtherPrimeInfo](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html#getOtherPrimeInfo())() Returns a copy of the otherPrimeInfo or null if there are only two prime factors (p and q). |
| BigInteger | [getPrimeExponentP](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html#getPrimeExponentP())() Returns the primeExponentP. |
| BigInteger | [getPrimeExponentQ](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html#getPrimeExponentQ())() Returns the primeExponentQ. |
| BigInteger | [getPrimeP](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html#getPrimeP())() Returns the primeP. |
| BigInteger | [getPrimeQ](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html#getPrimeQ())() Returns the primeQ. |
| BigInteger | [getPublicExponent](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.html#getPublicExponent())() Returns the public exponent. |

### Inherited Method Summary

From class [java.security.spec.RSAPrivateKeySpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPrivateKeySpec.html)

|---|---|
| BigInteger | [getModulus](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPrivateKeySpec.html#getModulus())() Returns the modulus. |
| BigInteger | [getPrivateExponent](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAPrivateKeySpec.html#getPrivateExponent())() Returns the private exponent. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**RSAMultiPrimePrivateCrtKeySpec**
(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient, [RSAOtherPrimeInfo\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAOtherPrimeInfo.html) 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if any of the parameters, i.e. `modulus`, `publicExponent`, `privateExponent`, `primeP`, `primeQ`, `primeExponentP`, `primeExponentQ`, `crtCoefficient`, is null. |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if an empty, i.e. 0-length, `otherPrimeInfo` is specified. |
|---|---|

## Public Methods

#### public BigInteger
**getCrtCoefficient**
()

Returns the crtCoefficient.

##### Returns

- the crtCoefficient.

#### public [RSAOtherPrimeInfo\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/RSAOtherPrimeInfo.html)
**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.

#### public BigInteger
**getPrimeExponentP**
()

Returns the primeExponentP.

##### Returns

- the primeExponentP.

#### public BigInteger
**getPrimeExponentQ**
()

Returns the primeExponentQ.

##### Returns

- the primeExponentQ.

#### public BigInteger
**getPrimeP**
()

Returns the primeP.

##### Returns

- the primeP.

#### public BigInteger
**getPrimeQ**
()

Returns the primeQ.

##### Returns

- the primeQ.

#### public BigInteger
**getPublicExponent**
()

Returns the public exponent.

##### Returns

- the public exponent.