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

◆ SaveToMemoryStore()

unsafe byte[] Internal.Cryptography.Pal.StorePal.SaveToMemoryStore ( CertStoreSaveAs dwSaveAs)
inlineprivate

Definition at line 176 of file StorePal.cs.

177 {
178 CRYPTOAPI_BLOB pvSaveToPara = new CRYPTOAPI_BLOB(0, null);
179 if (!global::Interop.crypt32.CertSaveStore(_certStore, CertEncodingType.All, dwSaveAs, CertStoreSaveTo.CERT_STORE_SAVE_TO_MEMORY, ref pvSaveToPara, 0))
180 {
181 throw Marshal.GetLastWin32Error().ToCryptographicException();
182 }
183 byte[] array = new byte[pvSaveToPara.cbData];
184 fixed (byte* pbData = array)
185 {
186 pvSaveToPara.pbData = pbData;
187 if (!global::Interop.crypt32.CertSaveStore(_certStore, CertEncodingType.All, dwSaveAs, CertStoreSaveTo.CERT_STORE_SAVE_TO_MEMORY, ref pvSaveToPara, 0))
188 {
189 throw Marshal.GetLastWin32Error().ToCryptographicException();
190 }
191 }
192 return array;
193 }
SafeCertStoreHandle _certStore
Definition StorePal.cs:13

References Internal.Cryptography.Pal.StorePal._certStore, System.array, Internal.Cryptography.Pal.Native.CRYPTOAPI_BLOB.cbData, and System.Runtime.InteropServices.Marshal.GetLastWin32Error().

Referenced by Internal.Cryptography.Pal.StorePal.Export().