113 references to BCryptNative
System.Core (113)
Microsoft\Win32\SafeHandles\BCryptSafeHandles.cs (6)
28
private static extern
BCryptNative
.ErrorCode BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int flags);
31
return BCryptCloseAlgorithmProvider(handle, 0) ==
BCryptNative
.ErrorCode.Success;
63
private static extern
BCryptNative
.ErrorCode BCryptDestroyHash(IntPtr hHash);
66
bool success = BCryptDestroyHash(handle) ==
BCryptNative
.ErrorCode.Success;
87
internal static extern
BCryptNative
.ErrorCode BCryptDestroyKey(IntPtr hKey);
91
return BCryptDestroyKey(handle) ==
BCryptNative
.ErrorCode.Success;
System\Security\Cryptography\BCryptHashAlgorithm.cs (15)
46
algorithmHandle =
BCryptNative
.OpenAlgorithm(algorithm, implementation);
74
if (!
BCryptNative
.BCryptSupported) {
127
int hashObjectSize =
BCryptNative
.GetInt32Property(m_algorithmHandle,
128
BCryptNative
.ObjectPropertyName.ObjectLength);
138
BCryptNative
.ErrorCode error =
BCryptNative
.UnsafeNativeMethods.BCryptCreateHash(m_algorithmHandle,
146
if (error !=
BCryptNative
.ErrorCode.Success) {
193
BCryptNative
.ErrorCode error;
197
error =
BCryptNative
.UnsafeNativeMethods.BCryptHashData(m_hashHandle,
204
if (error !=
BCryptNative
.ErrorCode.Success) {
217
int hashSize =
BCryptNative
.GetInt32Property(m_hashHandle,
BCryptNative
.HashPropertyName.HashLength);
220
BCryptNative
.ErrorCode error =
BCryptNative
.UnsafeNativeMethods.BCryptFinishHash(m_hashHandle,
225
if (error !=
BCryptNative
.ErrorCode.Success) {
System\Security\Cryptography\BCryptNative.cs (1)
45
public
BCryptNative
.KeyBlobMagicNumber dwMagic; // BCRYPT_DSA_PUBLIC_MAGIC_V2 or BCRYPT_DSA_PRIVATE_MAGIC_V2
System\Security\Cryptography\CngAlgorithm.cs (14)
109
s_rsa = new CngAlgorithm(
BCryptNative
.AlgorithmName.Rsa);
120
s_ecdh = new CngAlgorithm(
BCryptNative
.AlgorithmName.ECDH);
132
s_ecdhp256 = new CngAlgorithm(
BCryptNative
.AlgorithmName.ECDHP256);
144
s_ecdhp384 = new CngAlgorithm(
BCryptNative
.AlgorithmName.ECDHP384);
156
s_ecdhp521 = new CngAlgorithm(
BCryptNative
.AlgorithmName.ECDHP521);
168
s_ecdsa = new CngAlgorithm(
BCryptNative
.AlgorithmName.ECDsa);
180
s_ecdsap256 = new CngAlgorithm(
BCryptNative
.AlgorithmName.ECDsaP256);
192
s_ecdsap384 = new CngAlgorithm(
BCryptNative
.AlgorithmName.ECDsaP384);
204
s_ecdsap521 = new CngAlgorithm(
BCryptNative
.AlgorithmName.ECDsaP521);
216
s_md5 = new CngAlgorithm(
BCryptNative
.AlgorithmName.MD5);
228
s_sha1 = new CngAlgorithm(
BCryptNative
.AlgorithmName.Sha1);
240
s_sha256 = new CngAlgorithm(
BCryptNative
.AlgorithmName.Sha256);
252
s_sha384 = new CngAlgorithm(
BCryptNative
.AlgorithmName.Sha384);
264
s_sha512 = new CngAlgorithm(
BCryptNative
.AlgorithmName.Sha512);
System\Security\Cryptography\ECDsaCng.cs (6)
281
using (BCryptHashAlgorithm hashAlgorithm = new BCryptHashAlgorithm(HashAlgorithm,
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider)) {
297
using (BCryptHashAlgorithm hashAlgorithm = new BCryptHashAlgorithm(HashAlgorithm,
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider)) {
379
using (BCryptHashAlgorithm hashAlgorithm = new BCryptHashAlgorithm(HashAlgorithm,
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider)) {
396
using (BCryptHashAlgorithm hashAlgorithm = new BCryptHashAlgorithm(HashAlgorithm,
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider)) {
453
using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name),
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider)) {
464
using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name),
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider)) {
System\Security\Cryptography\MD5Cng.cs (1)
26
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider);
System\Security\Cryptography\NCryptNative.cs (30)
399
[In] ref
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO pPaddingInfo,
409
[In] ref
BCryptNative
.BCRYPT_PSS_PADDING_INFO pPaddingInfo,
418
[In] ref
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO pPaddingInfo,
427
[In] ref
BCryptNative
.BCRYPT_PSS_PADDING_INFO pPaddingInfo,
438
[In] ref
BCryptNative
.BCRYPT_OAEP_PADDING_INFO pvPadding,
458
[In] ref
BCryptNative
.BCRYPT_OAEP_PADDING_INFO pvPadding,
599
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO();
617
BCryptNative
.BCRYPT_OAEP_PADDING_INFO oaepInfo = new
BCryptNative
.BCRYPT_OAEP_PADDING_INFO();
631
ref
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO pvPadding,
702
BCryptNative
.BCRYPT_OAEP_PADDING_INFO oaepInfo = new
BCryptNative
.BCRYPT_OAEP_PADDING_INFO();
717
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO();
730
ref
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO pvPadding,
802
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO();
826
BCryptNative
.BCRYPT_PSS_PADDING_INFO pssInfo = new
BCryptNative
.BCRYPT_PSS_PADDING_INFO();
877
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new
BCryptNative
.BCRYPT_PKCS1_PADDING_INFO();
903
BCryptNative
.BCRYPT_PSS_PADDING_INFO pssInfo = new
BCryptNative
.BCRYPT_PSS_PADDING_INFO();
953
BCryptNative
.KeyBlobMagicNumber algorithmMagic;
955
BCryptNative
.MapAlgorithmIdToMagic(algorithm, out algorithmMagic, out keySize);
1029
Contract.Requires(hmacKey == null || kdf ==
BCryptNative
.KeyDerivationFunction.Hmac);
1165
BCryptNative
.KeyDerivationFunction.Hash,
1188
BCryptNative
.KeyDerivationFunction.Hmac,
1225
BCryptNative
.KeyDerivationFunction.Tls,
System\Security\Cryptography\Rfc4050KeyFormatter.cs (3)
266
case
BCryptNative
.BCRYPT_ECC_CURVE_NISTP256:
270
case
BCryptNative
.BCRYPT_ECC_CURVE_NISTP384:
274
case
BCryptNative
.BCRYPT_ECC_CURVE_NISTP521:
System\Security\Cryptography\RsaCng.cs (19)
17
private static CngKeyBlobFormat s_rsaFullPrivateBlob = new CngKeyBlobFormat(
BCryptNative
.KeyBlobType.RsaFullPrivateBlob);
18
private static CngKeyBlobFormat s_rsaPrivateBlob = new CngKeyBlobFormat(
BCryptNative
.KeyBlobType.RsaPrivateBlob);
19
private static CngKeyBlobFormat s_rsaPublicBlob = new CngKeyBlobFormat(
BCryptNative
.KeyBlobType.RsaPublicBlob);
168
using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name),
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider))
181
using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name),
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider))
197
if (magic != (int)
BCryptNative
.KeyBlobMagicNumber.RsaPublic)
200
if (magic != (int)
BCryptNative
.KeyBlobMagicNumber.RsaPrivate && magic != (int)
BCryptNative
.KeyBlobMagicNumber.RsaFullPrivateMagic)
209
if (magic != (int)
BCryptNative
.KeyBlobMagicNumber.RsaPrivate && magic != (int)
BCryptNative
.KeyBlobMagicNumber.RsaFullPrivateMagic)
253
BCryptNative
.BCRYPT_RSAKEY_BLOB* pBcryptBlob = (
BCryptNative
.BCRYPT_RSAKEY_BLOB*)pRsaBlob;
255
int offset = Marshal.SizeOf(typeof(
BCryptNative
.BCRYPT_RSAKEY_BLOB));
339
int blobSize = Marshal.SizeOf(typeof(
BCryptNative
.BCRYPT_RSAKEY_BLOB)) +
354
BCryptNative
.BCRYPT_RSAKEY_BLOB* pBcryptBlob = (
BCryptNative
.BCRYPT_RSAKEY_BLOB*)pRsaBlob;
355
pBcryptBlob->Magic = publicOnly ?
BCryptNative
.KeyBlobMagicNumber.RsaPublic :
356
BCryptNative
.KeyBlobMagicNumber.RsaPrivate;
369
int offset = Marshal.SizeOf(typeof(
BCryptNative
.BCRYPT_RSAKEY_BLOB));
System\Security\Cryptography\SHA1Cng.cs (1)
23
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider);
System\Security\Cryptography\SHA256Cng.cs (1)
22
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider);
System\Security\Cryptography\SHA384Cng.cs (1)
22
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider);
System\Security\Cryptography\SHA512Cng.cs (1)
22
BCryptNative
.ProviderName.MicrosoftPrimitiveProvider);
System\Security\Cryptography\X509Certificates\ECDsaCertificateExtensions.cs (14)
52
SafeBCryptKeyHandle publicKeyInfo =
BCryptNative
.ImportAsymmetricPublicKey(certPublicKeyInfo, 0);
87
byte[] keyBlob =
BCryptNative
.ExportBCryptKey(bcryptKeyHandle, blobFormat.Format);
96
byte[] keyBlob =
BCryptNative
.ExportBCryptKey(bcryptKeyHandle, blobFormat.Format);
127
using (SafeBCryptKeyHandle bcryptKeyHandle =
BCryptNative
.ImportAsymmetricPublicKey(certPublicKeyInfo, 0))
316
BCryptNative
.ErrorCode errorCode =
BCryptNative
.UnsafeNativeMethods.BCryptGetProperty(cryptHandle, propertyName, null, 0, out numBytesNeeded, 0);
317
if (errorCode !=
BCryptNative
.ErrorCode.Success)
321
errorCode =
BCryptNative
.UnsafeNativeMethods.BCryptGetProperty(cryptHandle, propertyName, propertyValue, propertyValue.Length, out numBytesNeeded, 0);
322
if (errorCode !=
BCryptNative
.ErrorCode.Success)
337
BCryptNative
.ErrorCode errorCode =
BCryptNative
.UnsafeNativeMethods.BCryptGetProperty(cryptHandle, propertyName, null, 0, out numBytesNeeded, 0);
338
return errorCode ==
BCryptNative
.ErrorCode.Success && numBytesNeeded > 0;
349
byte[] keyBlob =
BCryptNative
.ExportBCryptKey(bcryptKeyHandle,
BCryptNative
.BCRYPT_ECCPUBLIC_BLOB);