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

◆ ExportParameters() [2/2]

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

Definition at line 525 of file RSACng.cs.

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

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