DigestAlgorithm

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

Represents a hash algorithm used by HTTP Digest Authentication (RFC 7616) and XML Signature.

HTTP Digest Authentication algorithms are available as companion constants and can be resolved by algorithm name via from. 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.

SHA_256, SHA_384, and SHA_512 also expose an XML Signature digest uri that can be resolved via fromUri.

Security Recommendation: Use SHA_512_256 or SHA_512_256_SESS for new HTTP Digest 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, uri: String?)
constructor(name: String, hashName: String, isSession: Boolean)

Creates a DigestAlgorithm without an XML Signature uri.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The platform digest algorithm name (e.g., "MD5", "SHA-256", "SHA-512/256")

Link copied to clipboard

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

Link copied to clipboard

The algorithm name; for HTTP Digest Authentication this is the value of the algorithm parameter

Link copied to clipboard
val uri: String?

The XML Signature digest algorithm URI, if this algorithm has one

Functions

Link copied to clipboard

Creates a MessageDigest instance for this algorithm.