DigestAlgorithm

class DigestAlgorithm(val name: String, val hashName: String, val isSession: Boolean)(source)

Represents a hash algorithm as defined in RFC 7616.

Each algorithm defines the hash function used for computing digests in HTTP Digest Authentication. Session variants (those ending with -sess) modify the HA1 calculation to include the nonce and cnonce, providing additional security by binding the session to specific client entropy.

Security Recommendation: Use SHA_512_256 or SHA_512_256_SESS for new implementations. These provide the strongest security properties. MD5 variants are deprecated and should only be used for backward compatibility with legacy systems.

Report a problem

Constructors

Link copied to clipboard
constructor(name: String, hashName: String, isSession: Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The Java Security algorithm name used for MessageDigest (e.g., "MD5", "SHA-256")

Link copied to clipboard

Whether this is a session variant that incorporates nonce and cnonce into HA1

Link copied to clipboard

The name of the algorithm as it appears in HTTP headers (e.g., "MD5", "SHA-256-sess")

Functions

Link copied to clipboard

Creates a MessageDigest instance for this algorithm.