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

◆ DecodeX509EnhancedKeyUsageExtension()

unsafe void Internal.Cryptography.Pal.X509Pal.DecodeX509EnhancedKeyUsageExtension ( byte[] encoded,
out OidCollection usages )
inline

Implements Internal.Cryptography.Pal.IX509Pal.

Definition at line 84 of file X509Pal.cs.

85 {
86 usages = encoded.DecodeObject(CryptDecodeObjectStructType.X509_ENHANCED_KEY_USAGE, delegate(void* pvDecoded, int cbDecoded)
87 {
88 OidCollection oidCollection = new OidCollection();
89 int cUsageIdentifier = ((CERT_ENHKEY_USAGE*)pvDecoded)->cUsageIdentifier;
90 for (int i = 0; i < cUsageIdentifier; i++)
91 {
92 IntPtr ptr = ((CERT_ENHKEY_USAGE*)pvDecoded)->rgpszUsageIdentifier[i];
93 string oid = Marshal.PtrToStringAnsi(ptr);
94 Oid oid2 = new Oid(oid);
95 oidCollection.Add(oid2);
96 }
97 return oidCollection;
98 });
99 }
static unsafe? string PtrToStringAnsi(IntPtr ptr)
Definition Marshal.cs:630

References System.Security.Cryptography.OidCollection.Add(), and System.Runtime.InteropServices.Marshal.PtrToStringAnsi().