Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ExportParameters() [2/2]

static unsafe void System.Security.Cryptography.RSAImplementation.RSACng.ExportParameters ( ref RSAParameters rsaParams,
byte[] rsaBlob,
bool includePrivateParameters )
inlinestaticprivate

Definition at line 524 of file RSAImplementation.cs.

525 {
526 global::Interop.BCrypt.KeyBlobMagicNumber magic = (global::Interop.BCrypt.KeyBlobMagicNumber)BitConverter.ToInt32(rsaBlob, 0);
528 if (rsaBlob.Length < sizeof(global::Interop.BCrypt.BCRYPT_RSAKEY_BLOB))
529 {
530 throw global::Interop.NCrypt.ErrorCode.E_FAIL.ToCryptographicException();
531 }
532 fixed (byte* ptr = &rsaBlob[0])
533 {
534 global::Interop.BCrypt.BCRYPT_RSAKEY_BLOB* ptr2 = (global::Interop.BCrypt.BCRYPT_RSAKEY_BLOB*)ptr;
535 int offset = sizeof(global::Interop.BCrypt.BCRYPT_RSAKEY_BLOB);
536 rsaParams.Exponent = global::Interop.BCrypt.Consume(rsaBlob, ref offset, ptr2->cbPublicExp);
537 rsaParams.Modulus = global::Interop.BCrypt.Consume(rsaBlob, ref offset, ptr2->cbModulus);
539 {
540 rsaParams.P = global::Interop.BCrypt.Consume(rsaBlob, ref offset, ptr2->cbPrime1);
541 rsaParams.Q = global::Interop.BCrypt.Consume(rsaBlob, ref offset, ptr2->cbPrime2);
542 rsaParams.DP = global::Interop.BCrypt.Consume(rsaBlob, ref offset, ptr2->cbPrime1);
543 rsaParams.DQ = global::Interop.BCrypt.Consume(rsaBlob, ref offset, ptr2->cbPrime2);
544 rsaParams.InverseQ = global::Interop.BCrypt.Consume(rsaBlob, ref offset, ptr2->cbPrime1);
545 rsaParams.D = global::Interop.BCrypt.Consume(rsaBlob, ref offset, ptr2->cbModulus);
546 }
547 }
548 }
static void CheckMagicValueOfKey(global::Interop.BCrypt.KeyBlobMagicNumber magic, bool includePrivateParameters)

References System.Security.Cryptography.RSAImplementation.RSACng.CheckMagicValueOfKey(), System.offset, and System.BitConverter.ToInt32().