106 references to CapiNative
System.Core (106)
Microsoft\Win32\SafeHandles\CapiSafeHandles.cs (5)
115int error = (int)CapiNative.ErrorCode.Success; 130if (error != (int)CapiNative.ErrorCode.Success) { 299if (!CapiNative.UnsafeNativeMethods.CryptDuplicateKey(this, IntPtr.Zero, 0, out duplicate)) { 383int error = (int)CapiNative.ErrorCode.Success; 402if (error != (int)CapiNative.ErrorCode.Success) {
System\Security\Cryptography\AesCryptoServiceProvider.cs (35)
42string providerName = CapiNative.ProviderNames.MicrosoftEnhancedRsaAes; 44providerName = CapiNative.ProviderNames.MicrosoftEnhancedRsaAesPrototype; 47m_cspHandle = CapiNative.AcquireCsp(null, 49CapiNative.ProviderType.RsaAes, 50CapiNative.CryptAcquireContextFlags.VerifyContext, 86byte[] keyValue = CapiNative.ExportSymmetricKey(m_key); 108SafeCapiKeyHandle importedKey = CapiNative.ImportSymmetricKey(m_cspHandle, 177using (SafeCapiKeyHandle importedKey = CapiNative.ImportSymmetricKey(m_cspHandle, GetAlgorithmId(keyCopy.Length * 8), keyCopy)) { 243using (SafeCapiKeyHandle importedKey = CapiNative.ImportSymmetricKey(m_cspHandle, GetAlgorithmId(keyCopy.Length * 8), keyCopy)) { 316CapiNative.PROV_ENUMALGS algorithm = 317CapiNative.GetProviderParameterStruct<CapiNative.PROV_ENUMALGS>(csp, 318CapiNative.ProviderParameter.EnumerateAlgorithms, 319CapiNative.ProviderParameterFlags.RestartEnumeration); 322while (algorithm.aiAlgId != CapiNative.AlgorithmId.None) { 324case CapiNative.AlgorithmId.Aes128: 332case CapiNative.AlgorithmId.Aes192: 339case CapiNative.AlgorithmId.Aes256: 350algorithm = CapiNative.GetProviderParameterStruct<CapiNative.PROV_ENUMALGS>(csp, 351CapiNative.ProviderParameter.EnumerateAlgorithms, 352CapiNative.ProviderParameterFlags.None); 376if (!CapiNative.UnsafeNativeMethods.CryptGenKey(m_cspHandle, 378CapiNative.KeyFlags.Exportable, 407if (!CapiNative.UnsafeNativeMethods.CryptGenRandom(m_cspHandle, iv.Length, iv)) { 417private static CapiNative.AlgorithmId GetAlgorithmId(int keySize) { 420((((int)Contract.Result<CapiNative.AlgorithmId>()) & (int)CapiNative.AlgorithmClass.DataEncryption) == (int)CapiNative.AlgorithmClass.DataEncryption) || 421Contract.Result<CapiNative.AlgorithmId>() == CapiNative.AlgorithmId.None); 425return CapiNative.AlgorithmId.Aes128; 428return CapiNative.AlgorithmId.Aes192; 431return CapiNative.AlgorithmId.Aes256; 434return CapiNative.AlgorithmId.None;
System\Security\Cryptography\CapiHashAlgorithm.cs (13)
21private CapiNative.AlgorithmId m_algorithmId; 30CapiNative.ProviderType providerType, 31CapiNative.AlgorithmId algorithm) { 33Contract.Requires((CapiNative.AlgorithmClass)((uint)algorithm & (uint)CapiNative.AlgorithmClass.Hash) == CapiNative.AlgorithmClass.Hash); 38m_cspHandle = CapiNative.AcquireCsp(null, 41CapiNative.CryptAcquireContextFlags.VerifyContext, 74if (!CapiNative.UnsafeNativeMethods.CryptCreateHash(m_cspHandle, 82if (error == (int)CapiNative.ErrorCode.BadAlgorithmId) { 127if (!CapiNative.UnsafeNativeMethods.CryptHashData(m_hashHandle, dataPtr + ibStart, cbSize, 0)) { 142return CapiNative.GetHashParameter(m_hashHandle, CapiNative.HashParameter.HashValue);
System\Security\Cryptography\CapiNative.cs (9)
524if (throwPlatformException && (error == (int)CapiNative.ErrorCode.ProviderTypeNotDefined || 525error == (int)CapiNative.ErrorCode.KeysetNotDefined)) { 607internal static byte[] GetHashParameter(SafeCapiHashHandle hashHandle, CapiNative.HashParameter parameter) { 609Contract.Requires(CapiNative.HashParameter.AlgorithmId <= parameter && parameter <= CapiNative.HashParameter.HashSize); 617if (!CapiNative.UnsafeNativeMethods.CryptGetHashParam(hashHandle, parameter, null, ref parameterSize, 0)) { 623if (!CapiNative.UnsafeNativeMethods.CryptGetHashParam(hashHandle, parameter, parameterValue, ref parameterSize, 0)) { 1027SafeLocalAllocHandle pb = CapiNative.LocalAlloc(CapiNative.LMEM_FIXED, new IntPtr(arr.Length));
System\Security\Cryptography\CapiSymmetricAlgorithm.cs (11)
258if (!CapiNative.UnsafeNativeMethods.CryptEncrypt(m_key, 305CapiNative.UnsafeNativeMethods.CryptGenRandom(m_provider, result.Length - 1, result); 408if (!CapiNative.UnsafeNativeMethods.CryptDecrypt(m_key, 441CapiNative.UnsafeNativeMethods.CryptEncrypt(m_key, 453CapiNative.UnsafeNativeMethods.CryptDecrypt(m_key, 592CapiNative.SetKeyParameter(encryptionKey, CapiNative.KeyParameter.Mode, (int)cipherMode); 596CapiNative.SetKeyParameter(encryptionKey, CapiNative.KeyParameter.IV, iv); 601CapiNative.SetKeyParameter(encryptionKey, CapiNative.KeyParameter.ModeBits, feedbackSize);
System\Security\Cryptography\SHA256CryptoServiceProvider.cs (3)
21m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, 22CapiNative.ProviderType.RsaAes, 23CapiNative.AlgorithmId.Sha256);
System\Security\Cryptography\SHA384CryptoServiceProvider.cs (3)
21m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, 22CapiNative.ProviderType.RsaAes, 23CapiNative.AlgorithmId.Sha384);
System\Security\Cryptography\SHA512CryptoServiceProvider.cs (3)
21m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, 22CapiNative.ProviderType.RsaAes, 23CapiNative.AlgorithmId.Sha512);
System\Security\Cryptography\StrongNameSignatureInformation.cs (3)
22CapiNative.GetAlgorithmName(CapiNative.AlgorithmId.Sha1); 48get { return CapiNative.HResultForVerificationResult(m_verificationResult); }
System\Security\Cryptography\X509Certificates\AuthenticodeSignatureInformation.cs (3)
21private CapiNative.AlgorithmId m_hashAlgorithmId; 87get { return CapiNative.GetAlgorithmName(m_hashAlgorithmId); } 94get { return CapiNative.HResultForVerificationResult(m_verificationResult); }
System\Security\Cryptography\X509Certificates\RSACertificateExtensions.cs (7)
34IntPtr structType = new IntPtr(CapiNative.CNG_RSA_PUBLIC_KEY_BLOB); 38bool result = CapiNative.DecodeObject(structType, asn.RawData, out cngBlobHandle, out cngBlobLength); 168case CapiNative.CALG_RSA_SIGN: 169case CapiNative.CALG_RSA_KEYX: 180CapiNative.CRYPT_OID_INFO oidInfo = CapiNative.CryptFindOIDInfo(CapiNative.CRYPT_OID_INFO_OID_KEY, oidHandle, 0);
System\Security\Cryptography\X509Certificates\TimestampInformation.cs (3)
18private CapiNative.AlgorithmId m_hashAlgorithmId; 48get { return CapiNative.GetAlgorithmName(m_hashAlgorithmId); } 55get { return CapiNative.HResultForVerificationResult(m_verificationResult); }
System\Security\Cryptography\X509Certificates\X509Native.cs (3)
352public CapiNative.AlgorithmId algHash; 369public CapiNative.AlgorithmId algHash; 408public static extern int CertVerifyAuthenticodeLicense(ref CapiNative.CRYPTOAPI_BLOB pLicenseBlob,
System\Security\Cryptography\Xml\ManifestSignedXml.cs (5)
156CapiNative.CRYPTOAPI_BLOB keyBlob = new CapiNative.CRYPTOAPI_BLOB(); 160int hrToken = CapiNative.UnsafeNativeMethods._AxlPublicKeyBlobToPublicKeyToken(ref keyBlob, 500CapiNative.CRYPTOAPI_BLOB xmlBlob = new CapiNative.CRYPTOAPI_BLOB();