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

◆ Open() [4/4]

static CngKey System.Security.Cryptography.CngKey.Open ( string keyName,
CngProvider provider,
CngKeyOpenOptions openOptions )
inlinestatic

Definition at line 809 of file CngKey.cs.

810 {
811 if (keyName == null)
812 {
813 throw new ArgumentNullException("keyName");
814 }
815 if (provider == null)
816 {
817 throw new ArgumentNullException("provider");
818 }
819 SafeNCryptProviderHandle safeNCryptProviderHandle = provider.OpenStorageProvider();
821 global::Interop.NCrypt.ErrorCode errorCode = global::Interop.NCrypt.NCryptOpenKey(safeNCryptProviderHandle, out phKey, keyName, 0, openOptions);
822 if (errorCode != 0)
823 {
824 throw errorCode.ToCryptographicException();
825 }
826 return new CngKey(safeNCryptProviderHandle, phKey);
827 }
CngKey(SafeNCryptProviderHandle providerHandle, SafeNCryptKeyHandle keyHandle)
Definition CngKey.cs:209

References System.Security.Cryptography.CngKey.CngKey().