Table of Contents

Enum DigestCryptoAlgorithm

Namespace
Cuemon.AspNetCore.Authentication.Digest
Assembly
Cuemon.AspNetCore.Authentication.dll

Specifies the cryptographic algorithms used in Digest authentication.

public enum DigestCryptoAlgorithm

Fields

Md5 = -2

The Message Digest 5 (MD5) algorithm (128 bits).

Md5Session = -1

The Message Digest 5 (MD5) algorithm (128 bits) session variant.

Sha256 = 0

The Secure Hashing Algorithm (SHA256) algorithm (256 bits).

Sha256Session = 1

The Secure Hashing Algorithm (SHA256) algorithm (256 bits) session variant.

Sha512Slash256 = 2

The Secure Hashing Algorithm (SHA512/256) algorithm (256 bits).

Sha512Slash256Session = 3

The Secure Hashing Algorithm (SHA512/256) algorithm (256 bits) session variant.

Examples

The following example demonstrates how DigestCryptoAlgorithm selects the hash algorithm used by DigestAuthorizationHeaderBuilder.

using System;
using Cuemon.AspNetCore.Authentication.Digest;

namespace MyApp.Examples;

public static class DigestCryptoAlgorithmExample
{
    public static void Demonstrate()
    {
        var builder = new DigestAuthorizationHeaderBuilder(DigestCryptoAlgorithm.Sha512Slash256);

        Console.WriteLine(builder.DigestAlgorithm);
    }
}