2 instantiations of SafeNCryptKeyHandle
System.Core (2)
System\Security\Cryptography\X509Certificates\X509Native.cs (2)
68return new SafeNCryptKeyHandle(privateKeyPtr, certificateContext); 102var newKeyHandle = new SafeNCryptKeyHandle(privateKey.DangerousGetHandle(), certificateContext);
93 references to SafeNCryptKeyHandle
System.Core (93)
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (2)
389internal SafeNCryptKeyHandle Duplicate() { 390return Duplicate<SafeNCryptKeyHandle>();
System\Security\Cryptography\CngKey.cs (10)
34private SafeNCryptKeyHandle m_keyHandle; 38private CngKey(SafeNCryptProviderHandle kspHandle, SafeNCryptKeyHandle keyHandle) { 114public SafeNCryptKeyHandle Handle { 441SafeNCryptKeyHandle keyHandle = NCryptNative.CreatePersistedKey(kspHandle, 519SafeNCryptKeyHandle keyHandle = null; 598SafeNCryptKeyHandle keyHandle; 714SafeNCryptKeyHandle keyHandle = NCryptNative.OpenKey(kspHandle, keyName, openOptions); 724public static CngKey Open(SafeNCryptKeyHandle keyHandle, CngKeyHandleOpenOptions keyHandleOpenOptions) { 732SafeNCryptKeyHandle keyHandleCopy = keyHandle.Duplicate(); 795private static void SetKeyProperties(SafeNCryptKeyHandle keyHandle,
System\Security\Cryptography\ECDiffieHellmanCng.cs (5)
96using (SafeNCryptKeyHandle importHandle = key.Handle) { 362using (SafeNCryptKeyHandle localKey = Key.Handle) 363using (SafeNCryptKeyHandle otherKey = otherPartyPublicKey.Handle) { 525using (SafeNCryptKeyHandle localHandle = Key.Handle) 526using (SafeNCryptKeyHandle otherPartyHandle = otherPartyPublicKey.Handle) {
System\Security\Cryptography\ECDsaCng.cs (4)
77using (SafeNCryptKeyHandle keyHandle = key.Handle) { 322using (SafeNCryptKeyHandle keyHandle = Key.Handle) { 418using (SafeNCryptKeyHandle keyHandle = Key.Handle) { 441private SafeNCryptKeyHandle KeyHandle {
System\Security\Cryptography\NCryptNative.cs (61)
224[Out] out SafeNCryptKeyHandle phKey, 234internal static extern ErrorCode NCryptDeleteKey(SafeNCryptKeyHandle hKey, int flags); 252internal static extern ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, 265internal static extern ErrorCode NCryptFinalizeKey(SafeNCryptKeyHandle hKey, int dwFlags); 309[Out] out SafeNCryptKeyHandle phKey, 319[Out] out SafeNCryptKeyHandle phKey, 336internal static extern ErrorCode NCryptSecretAgreement(SafeNCryptKeyHandle hPrivKey, 337SafeNCryptKeyHandle hPubKey, 376internal static extern ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, 389internal static extern ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, 398internal static extern ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, 408internal static extern ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, 417internal static extern ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, 426internal static extern ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, 435internal static extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, 445internal static extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, 455internal static extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, 465internal static extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, 480private delegate ErrorCode NCryptDecryptor<T>(SafeNCryptKeyHandle hKey, 493private delegate ErrorCode NCryptEncryptor<T>(SafeNCryptKeyHandle hKey, 506private delegate ErrorCode NCryptHashSigner<T>(SafeNCryptKeyHandle hKey, 519private delegate ErrorCode NCryptSignatureVerifier<T>(SafeNCryptKeyHandle hKey, 539private static byte[] DecryptData<T>(SafeNCryptKeyHandle key, 598internal static byte[] DecryptDataPkcs1(SafeNCryptKeyHandle key, byte[] data) { 612internal static byte[] DecryptDataOaep(SafeNCryptKeyHandle key, 628private static ErrorCode Pkcs1PaddingDecryptionWrapper(SafeNCryptKeyHandle hKey, 652private static byte[] EncryptData<T>(SafeNCryptKeyHandle key, 697internal static byte[] EncryptDataOaep(SafeNCryptKeyHandle key, 716internal static byte[] EncryptDataPkcs1(SafeNCryptKeyHandle key, byte[] data) { 727private static ErrorCode Pkcs1PaddingEncryptionWrapper(SafeNCryptKeyHandle hKey, 750private static byte[] SignHash<T>(SafeNCryptKeyHandle key, 794internal static byte[] SignHashPkcs1(SafeNCryptKeyHandle key, 816internal static byte[] SignHashPss(SafeNCryptKeyHandle key, 841private static bool VerifySignature<T>(SafeNCryptKeyHandle key, 867internal static bool VerifySignaturePkcs1(SafeNCryptKeyHandle key, 892internal static bool VerifySignaturePss(SafeNCryptKeyHandle key, 975internal static SafeNCryptKeyHandle CreatePersistedKey(SafeNCryptProviderHandle provider, 981Contract.Ensures(Contract.Result<SafeNCryptKeyHandle>() != null && 982!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 983!Contract.Result<SafeNCryptKeyHandle>().IsClosed); 985SafeNCryptKeyHandle keyHandle = null; 1003internal static void DeleteKey(SafeNCryptKeyHandle key) { 1236internal static SafeNCryptSecretHandle DeriveSecretAgreement(SafeNCryptKeyHandle privateKey, 1237SafeNCryptKeyHandle otherPartyPublicKey) { 1261internal static byte[] ExportKey(SafeNCryptKeyHandle key, string format) { 1330internal static void FinalizeKey(SafeNCryptKeyHandle key) { 1529internal static SafeNCryptKeyHandle ImportKey(SafeNCryptProviderHandle provider, 1535Contract.Ensures(Contract.Result<SafeNCryptKeyHandle>() != null && 1536!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 1537!Contract.Result<SafeNCryptKeyHandle>().IsClosed); 1539SafeNCryptKeyHandle keyHandle = null; 1557internal static SafeNCryptKeyHandle ImportKey(SafeNCryptProviderHandle provider, 1564Contract.Ensures(Contract.Result<SafeNCryptKeyHandle>() != null && 1565!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 1566!Contract.Result<SafeNCryptKeyHandle>().IsClosed); 1568SafeNCryptKeyHandle keyHandle = null; 1590internal static SafeNCryptKeyHandle OpenKey(SafeNCryptProviderHandle provider, 1596SafeNCryptKeyHandle key = null; 1770internal static byte[] SignHash(SafeNCryptKeyHandle key, byte[] hash) { 1814internal static byte[] SignHash(SafeNCryptKeyHandle key, byte[] hash, int expectedSize) 1888internal static bool VerifySignature(SafeNCryptKeyHandle key, byte[] hash, byte[] signature) {
System\Security\Cryptography\RsaCng.cs (3)
145private SafeNCryptKeyHandle KeyHandle 412SafeNCryptKeyHandle keyHandle = KeyHandle; 480SafeNCryptKeyHandle keyHandle = key.Handle;
System\Security\Cryptography\X509Certificates\ECDsaCertificateExtensions.cs (1)
31using (SafeNCryptKeyHandle privateKeyHandle = X509Native.TryAcquireCngPrivateKey(certificateContext, out openOptions))
System\Security\Cryptography\X509Certificates\RSACertificateExtensions.cs (1)
74using (SafeNCryptKeyHandle privateKeyHandle = X509Native.TryAcquireCngPrivateKey(certificateContext, out openOptions))
System\Security\Cryptography\X509Certificates\X509Native.cs (6)
46internal static SafeNCryptKeyHandle TryAcquireCngPrivateKey( 75SafeNCryptKeyHandle privateKey = null; 102var newKeyHandle = new SafeNCryptKeyHandle(privateKey.DangerousGetHandle(), certificateContext); 184SafeNCryptKeyHandle keyHandle) 439[In] SafeNCryptKeyHandle pvData); 449[Out] out SafeNCryptKeyHandle phCryptProvOrNCryptKey,