Show / Hide Table of Contents

    Class DigestAuthenticationUtility

    Provides an isolated set of members to work with HTTP Digest access authentication.

    Inheritance
    System.Object
    DigestAuthenticationUtility
    Namespace: Cuemon.AspNetCore.Authentication
    Assembly: Cuemon.AspNetCore.Authentication.dll
    Syntax
    public static class DigestAuthenticationUtility

    Fields

    | Improve this Doc

    CredentialAlgorithm

    The value of the header credential algorithm of a HTTP Digest access authentication.

    Declaration
    public const string CredentialAlgorithm = "algorithm"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialClientNonce

    The value of the header credential client nonce of a HTTP Digest access authentication.

    Declaration
    public const string CredentialClientNonce = "cnonce"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialDigestUri

    The value of the header credential digest URI of a HTTP Digest access authentication.

    Declaration
    public const string CredentialDigestUri = "uri"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialNonce

    The value of the header credential nonce of a HTTP Digest access authentication.

    Declaration
    public const string CredentialNonce = "nonce"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialNonceCount

    The value of the header credential nonce count of a HTTP Digest access authentication.

    Declaration
    public const string CredentialNonceCount = "nc"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialOpaque

    The value of the header credential opaque of a HTTP Digest access authentication.

    Declaration
    public const string CredentialOpaque = "opaque"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialQualityOfProtection

    The value of the header credential quality of protection of a HTTP Digest access authentication.

    Declaration
    public const string CredentialQualityOfProtection = "qop"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialQualityOfProtectionOptions

    The value of the header credential quality of protection options of a HTTP Digest access authentication.

    Declaration
    public const string CredentialQualityOfProtectionOptions = "auth,auth-int"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialRealm

    The value of the header credential realm of a HTTP Digest access authentication.

    Declaration
    public const string CredentialRealm = "realm"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialResponse

    The value of the header credential response of a HTTP Digest access authentication.

    Declaration
    public const string CredentialResponse = "response"
    Field Value
    Type Description
    System.String
    | Improve this Doc

    CredentialUserName

    The value of the header credential user name of a HTTP Digest access authentication.

    Declaration
    public const string CredentialUserName = "username"
    Field Value
    Type Description
    System.String

    Methods

    | Improve this Doc

    ComputeHash1(IDictionary<String, String>, String, HashAlgorithmType)

    Computes a by parameter defined HashAlgorithmType hash value of the required values for the HTTP Digest access authentication HA1.

    Declaration
    public static string ComputeHash1(IDictionary<string, string> credentials, string password, HashAlgorithmType algorithm)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<System.String, System.String> credentials

    The credentials of the HA1 computed value (CredentialUserName, CredentialRealm).

    System.String password

    The password to include in the HA1 computed value.

    HashAlgorithmType algorithm

    The algorithm to use when computing the HA1 value.

    Returns
    Type Description
    System.String

    A System.String in the format of H('credentials[CredentialUserName]:credentials[CredentialRealm]:password').

    | Improve this Doc

    ComputeHash2(IDictionary<String, String>, String, HashAlgorithmType)

    Computes a by parameter defined HashAlgorithmType hash value of the required values for the HTTP Digest access authentication HA2.

    Declaration
    public static string ComputeHash2(IDictionary<string, string> credentials, string httpMethod, HashAlgorithmType algorithm)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<System.String, System.String> credentials

    The credentials of the HA2 computed value (CredentialDigestUri).

    System.String httpMethod

    The HTTP method to include in the HA2 computed value.

    HashAlgorithmType algorithm

    The algorithm to use when computing the HA2 value.

    Returns
    Type Description
    System.String

    A System.String in the format of H('httpMethod:credentials[CredentialDigestUri]').

    | Improve this Doc

    ComputeResponse(IDictionary<String, String>, String, String, HashAlgorithmType)

    Computes a by parameter defined HashAlgorithmType hash value of the required values for the HTTP Digest access authentication RESPONSE.

    Declaration
    public static byte[] ComputeResponse(IDictionary<string, string> credentials, string hash1, string hash2, HashAlgorithmType algorithm)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<System.String, System.String> credentials

    The credentials of the RESPONSE computed value (CredentialNonce, CredentialNonceCount, CredentialClientNonce, CredentialQualityOfProtection).

    System.String hash1

    The HA1 to include in the RESPONSE computed value.

    System.String hash2

    The HA2 to include in the RESPONSE computed value.

    HashAlgorithmType algorithm

    The algorithm to use when computing the RESPONSE value.

    Returns
    Type Description
    System.Byte[]

    A System.String in the format of H('hash1:credentials[CredentialNonce]:credentials[CredentialNonceCount]:credentials[CredentialClientNonce]:credentials[CredentialQualityOfProtection]:hash2').

    | Improve this Doc

    DefaultNonceExpiredParser(String, TimeSpan)

    A default implementation of a nonce parser.

    Declaration
    public static bool DefaultNonceExpiredParser(string nonce, TimeSpan timeToLive)
    Parameters
    Type Name Description
    System.String nonce

    The nonce protocol.

    System.TimeSpan timeToLive

    The time-to-live (ttl) of the nonce.

    Returns
    Type Description
    System.Boolean

    true if the specified nonce has expired compared to timeToLive; otherwise, false.

    | Improve this Doc

    DefaultNonceGenerator(DateTime, String, Byte[])

    A default implementation of a nonce generator.

    Declaration
    public static string DefaultNonceGenerator(DateTime timestamp, string entityTag, byte[] privateKey)
    Parameters
    Type Name Description
    System.DateTime timestamp

    The System.DateTime value to include in the generated nonce.

    System.String entityTag

    An opaque identifier to include in the generated nonce.

    System.Byte[] privateKey

    A cryptographic private key to include as a cipher in the generated nonce.

    Returns
    Type Description
    System.String

    A nonce protocol in the format of 'timestamp:H(timestampentityTagprivateKey)'.

    | Improve this Doc

    DefaultOpaqueGenerator()

    A default implementation of opaque generator.

    Declaration
    public static string DefaultOpaqueGenerator()
    Returns
    Type Description
    System.String

    An opaque value consisting of hexadecimal characters with a length of 32 bytes.

    | Improve this Doc

    ParseAlgorithm(HashAlgorithmType)

    Converts the specified algorithm to its HTTP Digest access authentication header credential algorithm equivalent.

    Declaration
    public static string ParseAlgorithm(HashAlgorithmType algorithm)
    Parameters
    Type Name Description
    HashAlgorithmType algorithm

    The algorithm to convert.

    Returns
    Type Description
    System.String

    A string containing either MD5, SHA-256 or SHA-512-256.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX