109 references to NCryptNative
System.Core (109)
System\Security\Cryptography\CngKey.cs (78)
60
string group =
NCryptNative
.GetPropertyAsString(m_keyHandle,
61
NCryptNative
.KeyPropertyName.AlgorithmGroup,
80
string algorithm =
NCryptNative
.GetPropertyAsString(m_keyHandle,
81
NCryptNative
.KeyPropertyName.Algorithm,
94
int policy =
NCryptNative
.GetPropertyAsDWord(m_keyHandle,
95
NCryptNative
.KeyPropertyName.ExportPolicy,
103
NCryptNative
.KeyPropertyName.ExportPolicy,
140
ephemeralProperty =
NCryptNative
.GetProperty(m_keyHandle,
141
NCryptNative
.KeyPropertyName.ClrIsEphemeral,
162
NCryptNative
.SetProperty(m_keyHandle,
163
NCryptNative
.KeyPropertyName.ClrIsEphemeral,
176
int type =
NCryptNative
.GetPropertyAsDWord(m_keyHandle,
177
NCryptNative
.KeyPropertyName.KeyType,
198
return
NCryptNative
.GetPropertyAsString(m_keyHandle,
199
NCryptNative
.KeyPropertyName.Name,
217
NCryptNative
.ErrorCode errorCode =
NCryptNative
.GetPropertyAsInt(
219
NCryptNative
.KeyPropertyName.PublicKeyLength,
225
if (errorCode ==
NCryptNative
.ErrorCode.Success) {
229
return
NCryptNative
.GetPropertyAsDWord(m_keyHandle,
230
NCryptNative
.KeyPropertyName.Length,
242
int keyUsage =
NCryptNative
.GetPropertyAsDWord(m_keyHandle,
243
NCryptNative
.KeyPropertyName.KeyUsage,
256
return
NCryptNative
.GetPropertyAsIntPtr(m_keyHandle,
257
NCryptNative
.KeyPropertyName.ParentWindowHandle,
265
NCryptNative
.SetProperty(m_keyHandle,
266
NCryptNative
.KeyPropertyName.ParentWindowHandle,
279
string provider =
NCryptNative
.GetPropertyAsString(m_kspHandle,
280
NCryptNative
.ProviderPropertyName.Name,
317
return
NCryptNative
.GetPropertyAsString(m_keyHandle,
318
NCryptNative
.KeyPropertyName.UniqueName,
333
NCryptNative
.NCRYPT_UI_POLICY uiPolicy =
334
NCryptNative
.GetPropertyAsStruct<
NCryptNative
.NCRYPT_UI_POLICY>(m_keyHandle,
335
NCryptNative
.KeyPropertyName.UIPolicy,
338
string useContext =
NCryptNative
.GetPropertyAsString(m_keyHandle,
339
NCryptNative
.KeyPropertyName.UseContext,
373
kspName =
NCryptNative
.GetPropertyAsString(m_kspHandle,
374
NCryptNative
.ProviderPropertyName.Name,
421
if (!
NCryptNative
.NCryptSupported) {
440
SafeNCryptProviderHandle kspHandle =
NCryptNative
.OpenStorageProvider(creationParameters.Provider.Provider);
441
SafeNCryptKeyHandle keyHandle =
NCryptNative
.CreatePersistedKey(kspHandle,
447
NCryptNative
.FinalizeKey(keyHandle);
472
NCryptNative
.DeleteKey(m_keyHandle);
513
if (!
NCryptNative
.NCryptSupported) {
517
using (SafeNCryptProviderHandle kspHandle =
NCryptNative
.OpenStorageProvider(provider.Provider)) {
522
NCryptNative
.ErrorCode error =
NCryptNative
.UnsafeNativeMethods.NCryptOpenKey(kspHandle,
530
bool keyNotFound = error ==
NCryptNative
.ErrorCode.KeyDoesNotExist ||
531
error ==
NCryptNative
.ErrorCode.NotFound;
533
if (error !=
NCryptNative
.ErrorCode.Success && !keyNotFound) {
537
return error ==
NCryptNative
.ErrorCode.Success;
581
if (!
NCryptNative
.NCryptSupported) {
597
SafeNCryptProviderHandle kspHandle =
NCryptNative
.OpenStorageProvider(provider.Provider);
601
keyHandle =
NCryptNative
.ImportKey(kspHandle, keyBlob, format.Format);
631
return
NCryptNative
.ExportKey(m_keyHandle, format.Format);
647
byte[] value =
NCryptNative
.GetProperty(m_keyHandle, name, options, out foundProperty);
650
throw new CryptographicException((int)
NCryptNative
.ErrorCode.NotFound);
669
NCryptNative
.GetProperty(m_keyHandle, name, options, out foundProperty);
700
if (!
NCryptNative
.NCryptSupported) {
713
SafeNCryptProviderHandle kspHandle =
NCryptNative
.OpenStorageProvider(provider.Provider);
714
SafeNCryptKeyHandle keyHandle =
NCryptNative
.OpenKey(kspHandle, keyName, openOptions);
739
IntPtr rawHandle =
NCryptNative
.GetPropertyAsIntPtr(keyHandle,
740
NCryptNative
.KeyPropertyName.ProviderHandle,
805
NCryptNative
.SetProperty(keyHandle,
806
NCryptNative
.KeyPropertyName.ExportPolicy,
812
NCryptNative
.SetProperty(keyHandle,
813
NCryptNative
.KeyPropertyName.KeyUsage,
819
NCryptNative
.SetProperty(keyHandle,
820
NCryptNative
.KeyPropertyName.ParentWindowHandle,
826
NCryptNative
.NCRYPT_UI_POLICY uiPolicy = new
NCryptNative
.NCRYPT_UI_POLICY();
833
NCryptNative
.SetProperty(keyHandle,
834
NCryptNative
.KeyPropertyName.UIPolicy,
840
NCryptNative
.SetProperty(keyHandle,
841
NCryptNative
.KeyPropertyName.UseContext,
849
NCryptNative
.SetProperty(keyHandle, property.Name, property.Value, property.Options);
860
NCryptNative
.SetProperty(m_keyHandle, property.Name, property.Value, property.Options);
System\Security\Cryptography\ECDiffieHellmanCng.cs (18)
55
if (!
NCryptNative
.NCryptSupported) {
80
if (!
NCryptNative
.NCryptSupported) {
352
NCryptNative
.SecretAgreementFlags flags =
353
UseSecretAgreementAsHmacKey ?
NCryptNative
.SecretAgreementFlags.UseSecretAsHmacKey :
NCryptNative
.SecretAgreementFlags.None;
372
using (SafeNCryptSecretHandle secretAgreement =
NCryptNative
.DeriveSecretAgreement(localKey, otherKey)) {
377
return
NCryptNative
.DeriveKeyMaterialHash(secretAgreement,
388
return
NCryptNative
.DeriveKeyMaterialHmac(secretAgreement,
405
return
NCryptNative
.DeriveKeyMaterialTls(secretAgreement, label, seed, flags);
427
return
NCryptNative
.DeriveKeyMaterialHash(
432
NCryptNative
.SecretAgreementFlags.None);
453
NCryptNative
.SecretAgreementFlags flags = hmacKey == null ?
454
NCryptNative
.SecretAgreementFlags.UseSecretAsHmacKey :
455
NCryptNative
.SecretAgreementFlags.None;
457
return
NCryptNative
.DeriveKeyMaterialHmac(
481
return
NCryptNative
.DeriveKeyMaterialTls(
485
NCryptNative
.SecretAgreementFlags.None);
527
return
NCryptNative
.DeriveSecretAgreement(localHandle, otherPartyHandle);
System\Security\Cryptography\ECDsaCng.cs (4)
37
if (!
NCryptNative
.NCryptSupported) {
62
if (!
NCryptNative
.NCryptSupported) {
325
return
NCryptNative
.SignHash(keyHandle, hash);
421
return
NCryptNative
.VerifySignature(keyHandle, hash, signature);
System\Security\Cryptography\RsaCng.cs (9)
99
CngProperty keySizeProperty = new CngProperty(
NCryptNative
.KeyPropertyName.Length,
416
return
NCryptNative
.DecryptDataPkcs1(keyHandle, data);
420
return
NCryptNative
.DecryptDataOaep(keyHandle, data, padding.OaepHashAlgorithm.Name);
443
return
NCryptNative
.EncryptDataPkcs1(KeyHandle, data);
447
return
NCryptNative
.EncryptDataOaep(KeyHandle, data, padding.OaepHashAlgorithm.Name);
484
return
NCryptNative
.SignHashPkcs1(keyHandle, hash, hashAlgorithm.Name);
488
return
NCryptNative
.SignHashPss(keyHandle, hash, hashAlgorithm.Name, hash.Length);
520
return
NCryptNative
.VerifySignaturePkcs1(KeyHandle, hash, hashAlgorithm.Name, signature);
524
return
NCryptNative
.VerifySignaturePss(KeyHandle, hash, hashAlgorithm.Name, hash.Length, signature);