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

◆ ImportPublicKeyInfo()

static unsafe Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle Internal.Cryptography.Pal.X509Pal.ImportPublicKeyInfo ( SafeCertContextHandle certContext,
CryptImportPublicKeyInfoFlags importFlags )
inlinestaticprivate

Definition at line 279 of file X509Pal.cs.

280 {
281 bool success = false;
282 certContext.DangerousAddRef(ref success);
283 try
284 {
285 if (!global::Interop.crypt32.CryptImportPublicKeyInfoEx2(CertEncodingType.X509_ASN_ENCODING, &certContext.CertContext->pCertInfo->SubjectPublicKeyInfo, importFlags, null, out var phKey))
286 {
287 throw Marshal.GetHRForLastWin32Error().ToCryptographicException();
288 }
289 return phKey;
290 }
291 finally
292 {
293 if (success)
294 {
295 certContext.DangerousRelease();
296 }
297 }
298 }
CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo
Definition CERT_INFO.cs:19

References Internal.Cryptography.Pal.Native.SafeCertContextHandle.CertContext, System.Runtime.InteropServices.Marshal.GetHRForLastWin32Error(), Internal.Cryptography.Pal.Native.CERT_CONTEXT.pCertInfo, and Internal.Cryptography.Pal.Native.CERT_INFO.SubjectPublicKeyInfo.

Referenced by Internal.Cryptography.Pal.X509Pal.DecodeECPublicKey< TAlgorithm >().