61 references to EncryptionAlgorithm
Microsoft.AspNetCore.DataProtection (34)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (24)
108internal static bool IsGcmAlgorithm(EncryptionAlgorithm algorithm) 110return (EncryptionAlgorithm.AES_128_GCM <= algorithm && algorithm <= EncryptionAlgorithm.AES_256_GCM); 113private static int GetAlgorithmKeySizeInBits(EncryptionAlgorithm algorithm) 117case EncryptionAlgorithm.AES_128_CBC: 118case EncryptionAlgorithm.AES_128_GCM: 121case EncryptionAlgorithm.AES_192_CBC: 122case EncryptionAlgorithm.AES_192_GCM: 125case EncryptionAlgorithm.AES_256_CBC: 126case EncryptionAlgorithm.AES_256_GCM: 134private static string GetBCryptAlgorithmNameFromEncryptionAlgorithm(EncryptionAlgorithm algorithm) 138case EncryptionAlgorithm.AES_128_CBC: 139case EncryptionAlgorithm.AES_192_CBC: 140case EncryptionAlgorithm.AES_256_CBC: 141case EncryptionAlgorithm.AES_128_GCM: 142case EncryptionAlgorithm.AES_192_GCM: 143case EncryptionAlgorithm.AES_256_GCM: 167private static Type GetManagedTypeFromEncryptionAlgorithm(EncryptionAlgorithm algorithm) 171case EncryptionAlgorithm.AES_128_CBC: 172case EncryptionAlgorithm.AES_192_CBC: 173case EncryptionAlgorithm.AES_256_CBC: 174case EncryptionAlgorithm.AES_128_GCM: 175case EncryptionAlgorithm.AES_192_GCM: 176case EncryptionAlgorithm.AES_256_GCM:
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactory.cs (1)
106throw Error.Common_PropertyCannotBeNullOrEmpty(nameof(EncryptionAlgorithm));
AuthenticatedEncryption\CngGcmAuthenticatedEncryptorFactory.cs (1)
73throw Error.Common_PropertyCannotBeNullOrEmpty(nameof(EncryptionAlgorithm));
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorConfiguration.cs (3)
18/// The default value is <see cref="EncryptionAlgorithm.AES_256_CBC"/>. 20public EncryptionAlgorithm EncryptionAlgorithm { get; set; } = EncryptionAlgorithm.AES_256_CBC;
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializer.cs (2)
34configuration.EncryptionAlgorithm = (EncryptionAlgorithm)Enum.Parse(typeof(EncryptionAlgorithm), (string)encryptionElement.Attribute("algorithm")!);
DataProtectionBuilderExtensions.cs (3)
436/// algorithms specified in the <see cref="EncryptionAlgorithm"/> and 458/// algorithms specified in the <see cref="EncryptionAlgorithm"/> and 480/// algorithms specified in the <see cref="EncryptionAlgorithm"/> and
Microsoft.AspNetCore.DataProtection.Tests (27)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
21EncryptionAlgorithm = EncryptionAlgorithm.AES_192_CBC,
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorTests.cs (26)
23[InlineData(EncryptionAlgorithm.AES_128_CBC, ValidationAlgorithm.HMACSHA256)] 24[InlineData(EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA256)] 25[InlineData(EncryptionAlgorithm.AES_256_CBC, ValidationAlgorithm.HMACSHA256)] 26[InlineData(EncryptionAlgorithm.AES_128_CBC, ValidationAlgorithm.HMACSHA512)] 27[InlineData(EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA512)] 28[InlineData(EncryptionAlgorithm.AES_256_CBC, ValidationAlgorithm.HMACSHA512)] 29public void CreateAuthenticatedEncryptor_RoundTripsData_CngCbcImplementation(EncryptionAlgorithm encryptionAlgorithm, ValidationAlgorithm validationAlgorithm) 54[InlineData(EncryptionAlgorithm.AES_128_GCM)] 55[InlineData(EncryptionAlgorithm.AES_192_GCM)] 56[InlineData(EncryptionAlgorithm.AES_256_GCM)] 57public void CreateAuthenticatedEncryptor_RoundTripsData_CngGcmImplementation(EncryptionAlgorithm encryptionAlgorithm) 80[InlineData(EncryptionAlgorithm.AES_128_GCM)] 81[InlineData(EncryptionAlgorithm.AES_192_GCM)] 82[InlineData(EncryptionAlgorithm.AES_256_GCM)] 83public void CreateAuthenticatedEncryptor_RoundTripsData_AesGcmImplementation(EncryptionAlgorithm encryptionAlgorithm) 104public static TheoryData<EncryptionAlgorithm, ValidationAlgorithm, Func<HMAC>> CreateAuthenticatedEncryptor_RoundTripsData_ManagedImplementationData 107{ EncryptionAlgorithm.AES_128_CBC, ValidationAlgorithm.HMACSHA256, () => new HMACSHA256() }, 108{ EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA256, () => new HMACSHA256() }, 109{ EncryptionAlgorithm.AES_256_CBC, ValidationAlgorithm.HMACSHA256, () => new HMACSHA256() }, 110{ EncryptionAlgorithm.AES_128_CBC, ValidationAlgorithm.HMACSHA512, () => new HMACSHA512() }, 111{ EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA512, () => new HMACSHA512() }, 112{ EncryptionAlgorithm.AES_256_CBC, ValidationAlgorithm.HMACSHA512, () => new HMACSHA512() }, 118EncryptionAlgorithm encryptionAlgorithm, 147var descriptor = CreateDescriptor(EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA512, masterKey.ToSecret()); 170var descriptor = CreateDescriptor(EncryptionAlgorithm.AES_192_GCM, ValidationAlgorithm.HMACSHA512, masterKey.ToSecret()); 188private static AuthenticatedEncryptorDescriptor CreateDescriptor(EncryptionAlgorithm encryptionAlgorithm, ValidationAlgorithm validationAlgorithm, ISecret masterKey)