Pkcs1RsaPrivateKey constructor
Constructor.
Create a Pkcs1RsaPrivateKey from the modulus (n), private exponent (d), prime 1 (p) and prime 2 (q).
Implementation
Pkcs1RsaPrivateKey(
this.modulus, this.privateExponent, this.prime1, this.prime2)
: source = null {
_version = BigInt.zero;
// Calculate the other members
final phi = (prime1 - BigInt.one) * (prime2 - BigInt.one);
_publicExponent = privateExponent.modInverse(phi);
_exponent1 = privateExponent % (prime1 - BigInt.one);
_exponent2 = privateExponent % (prime2 - BigInt.one);
_coefficient = prime2.modInverse(prime1);
final notCorrect = _isCorrect();
if (notCorrect != null) {
throw ArgumentError(notCorrect);
}
}