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