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