DigestCredential

data class DigestCredential(realm: String, userName: String, digestUri: String, nonce: String, opaque: String?, nonceCount: String?, algorithm: String?, response: String, cnonce: String?, qop: String?) : Credential

Represents Digest credentials

For details see RFC2617

Constructors

Link copied to clipboard
fun DigestCredential(realm: String, userName: String, digestUri: String, nonce: String, opaque: String?, nonceCount: String?, algorithm: String?, response: String, cnonce: String?, qop: String?)

Properties

Link copied to clipboard
val algorithm: String?

digest algorithm name

Link copied to clipboard
val cnonce: String?

must be sent if qop is specified and must be null otherwise. Should be passed through unchanged.

Link copied to clipboard
val digestUri: String

may be an absolute URI or *

Link copied to clipboard
val nonce: String
Link copied to clipboard
val nonceCount: String?

must be sent if qop is specified and must be null otherwise

Link copied to clipboard
val opaque: String?

a string of data that is passed through unchanged

Link copied to clipboard
val qop: String?

quality of protection sign

Link copied to clipboard
val realm: String

digest auth realm

Link copied to clipboard
val response: String

consist of 32 hex digits (digested password and other fields as per RFC)

Link copied to clipboard
val userName: String

Extensions

Link copied to clipboard
fun DigestCredential.expectedDigest(method: HttpMethod, digester: MessageDigest, userNameRealmPasswordDigest: ByteArray): ByteArray

Calculates expected digest bytes for this DigestCredential

Link copied to clipboard
suspend fun DigestCredential.verifier(method: HttpMethod, digester: MessageDigest, userNameRealmPasswordDigest: suspend (String, String) -> ByteArray?): Boolean

Verifies credentials are valid for given method and digester and userNameRealmPasswordDigest