8 private static readonly
string[]
s_validOids =
new string[1] {
"1.2.840.113549.1.1.1" };
13 if (!algId.HasNullEquivalentParameters())
17 if (rSAPrivateKeyAsn.
Version > 0)
21 byte[]
array = rSAPrivateKeyAsn.
Modulus.ToByteArray(isUnsigned:
true, isBigEndian:
true);
22 int length = (array.Length + 1) / 2;
26 Exponent = rSAPrivateKeyAsn.
PublicExponent.ToByteArray(isUnsigned:
true, isBigEndian:
true),
41 Modulus = rSAPublicKeyAsn.
Modulus.ToByteArray(isUnsigned:
true, isBigEndian:
true),
42 Exponent = rSAPublicKeyAsn.
PublicExponent.ToByteArray(isUnsigned:
true, isBigEndian:
true)
77 copyFrom.CopyTo(asnWriter);
91 writer.WriteObjectIdentifier(
"1.2.840.113549.1.1.1");
98 if (rsaParameters.Modulus ==
null || rsaParameters.Exponent ==
null)
104 asnWriter.WriteKeyParameterInteger(rsaParameters.Modulus);
105 asnWriter.WriteKeyParameterInteger(rsaParameters.Exponent);
112 if (rsaParameters.Modulus ==
null || rsaParameters.Exponent ==
null)
116 if (rsaParameters.D ==
null || rsaParameters.P ==
null || rsaParameters.Q ==
null || rsaParameters.DP ==
null || rsaParameters.DQ ==
null || rsaParameters.InverseQ ==
null)
123 asnWriter.WriteKeyParameterInteger(rsaParameters.Modulus);
124 asnWriter.WriteKeyParameterInteger(rsaParameters.Exponent);
125 asnWriter.WriteKeyParameterInteger(rsaParameters.D);
126 asnWriter.WriteKeyParameterInteger(rsaParameters.P);
127 asnWriter.WriteKeyParameterInteger(rsaParameters.Q);
128 asnWriter.WriteKeyParameterInteger(rsaParameters.DP);
129 asnWriter.WriteKeyParameterInteger(rsaParameters.DQ);
130 asnWriter.WriteKeyParameterInteger(rsaParameters.InverseQ);
static string Cryptography_NotValidPrivateKey
static string Cryptography_Der_Invalid_Encoding
static string Cryptography_RSAPrivateKey_VersionTooNew
static string Cryptography_InvalidRsaParameters
static string Format(string resourceFormat, object p1)
BigInteger PrivateExponent
BigInteger PublicExponent
static RSAPrivateKeyAsn Decode(ReadOnlyMemory< byte > encoded, AsnEncodingRules ruleSet)
static RSAPublicKeyAsn Decode(ReadOnlyMemory< byte > encoded, AsnEncodingRules ruleSet)
BigInteger PublicExponent