CngCbcAuthenticatedEncryptionSettings Class

Settings for configuring an authenticated encryption mechanism which uses Windows CNG algorithms in CBC encryption + HMAC authentication modes.

Namespace
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
Assemblies
  • Microsoft.AspNetCore.DataProtection

Syntax

public sealed class CngCbcAuthenticatedEncryptionSettings : IInternalAuthenticatedEncryptionSettings
class Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings

Properties

Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings.EncryptionAlgorithm

The name of the algorithm to use for symmetric encryption. This property corresponds to the ‘pszAlgId’ parameter of BCryptOpenAlgorithmProvider. This property is required to have a value.

Return type:System.String
public string EncryptionAlgorithm { get; set; }
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings.EncryptionAlgorithmKeySize

The length (in bits) of the key that will be used for symmetric encryption. This property is required to have a value.

Return type:System.Int32
public int EncryptionAlgorithmKeySize { get; set; }
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings.EncryptionAlgorithmProvider

The name of the provider which contains the implementation of the symmetric encryption algorithm. This property corresponds to the ‘pszImplementation’ parameter of BCryptOpenAlgorithmProvider. This property is optional.

Return type:System.String
public string EncryptionAlgorithmProvider { get; set; }
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings.HashAlgorithm

The name of the algorithm to use for hashing data. This property corresponds to the ‘pszAlgId’ parameter of BCryptOpenAlgorithmProvider. This property is required to have a value.

Return type:System.String
public string HashAlgorithm { get; set; }
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings.HashAlgorithmProvider

The name of the provider which contains the implementation of the hash algorithm. This property corresponds to the ‘pszImplementation’ parameter of BCryptOpenAlgorithmProvider. This property is optional.

Return type:System.String
public string HashAlgorithmProvider { get; set; }

Methods

Validate()

Validates that this Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings is well-formed, i.e., that the specified algorithms actually exist and that they can be instantiated properly. An exception will be thrown if validation fails.

public void Validate()