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

◆ CopyWithPrivateKey() [4/4]

ICertificatePal Internal.Cryptography.Pal.CertificatePal.CopyWithPrivateKey ( RSA rsa)
inline

Implements Internal.Cryptography.ICertificatePal.

Definition at line 719 of file CertificatePal.cs.

720 {
722 ICertificatePal certificatePal = null;
723 if (rSACng != null)
724 {
726 if (certificatePal != null)
727 {
728 return certificatePal;
729 }
730 }
732 {
734 if (certificatePal != null)
735 {
736 return certificatePal;
737 }
738 }
739 RSAParameters parameters = rsa.ExportParameters(includePrivateParameters: true);
740 using (PinAndClear.Track(parameters.D))
741 {
742 using (PinAndClear.Track(parameters.P))
743 {
744 using (PinAndClear.Track(parameters.Q))
745 {
746 using (PinAndClear.Track(parameters.DP))
747 {
748 using (PinAndClear.Track(parameters.DQ))
749 {
750 using (PinAndClear.Track(parameters.InverseQ))
751 {
752 using RSACng rSACng2 = new RSACng();
753 rSACng2.ImportParameters(parameters);
754 return CopyWithEphemeralKey(rSACng2.Key);
755 }
756 }
757 }
758 }
759 }
760 }
761 }
ICertificatePal CopyWithEphemeralKey(CngKey cngKey)
unsafe ICertificatePal CopyWithPersistedCapiKey(CspKeyContainerInfo keyContainerInfo)
unsafe ICertificatePal CopyWithPersistedCngKey(CngKey cngKey)

References Internal.Cryptography.Pal.CertificatePal.CopyWithEphemeralKey(), Internal.Cryptography.Pal.CertificatePal.CopyWithPersistedCapiKey(), Internal.Cryptography.Pal.CertificatePal.CopyWithPersistedCngKey(), System.Security.Cryptography.RSAParameters.D, System.Security.Cryptography.RSAParameters.DP, System.Security.Cryptography.RSAParameters.DQ, System.Security.Cryptography.RSAParameters.InverseQ, System.Security.Cryptography.RSAParameters.P, System.Security.Cryptography.RSAParameters.Q, and Internal.Cryptography.PinAndClear.Track().