<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.19.1" />

Microsoft.IdentityModel.Tokens.EncryptingCredentials

public class EncryptingCredentials
A class for properties that are used for token encryption.
public string Alg { get; }

Gets the key wrap algorithm used for session key encryption.

Users can override the default CryptoProviderFactory with this property. This factory will be used for creating encryption providers.

public string Enc { get; }

Gets the data encryption algorithm.

public SecurityKey Key { get; }

Gets the SecurityKey used for encryption.

public SecurityKey KeyExchangePublicKey { get; set; }

Gets or sets the public key used in Key Agreement Algorithms.

public bool SetDefaultCtyClaim { get; set; }

Gets or sets a bool that controls if the encrypted token creation will set default 'cty' if not specified.

protected EncryptingCredentials(X509Certificate2 certificate, string alg, string enc)

Initializes a new instance of the EncryptingCredentials class.

public EncryptingCredentials(SecurityKey key, string alg, string enc)

Initializes a new instance of the EncryptingCredentials class.

Initializes a new instance of the EncryptingCredentials class.