Documentation

Digest
in package

HTTP auth digest class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.2.0

Table of Contents

Constants

ALGO_MD5  = 'MD5'
Digest constants
ALGO_MD5_SESS  = 'MD5-sess'
QOP_AUTH  = 'auth'
QOP_AUTH_INT  = 'auth-int'

Properties

$algorithm  : string
Algorithm
$body  : string|null
Body
$clientNonce  : string|null
Client nonce
$errors  : array<string|int, mixed>
Validation errors
$method  : string
Method
$nonce  : string|null
Nonce
$nonceCount  : string|null
Nonce count
$opaque  : string|null
Opaque
$password  : string|null
Password
$qop  : string|null
QOP
$realm  : string|null
Realm
$stale  : bool
Stale flag
$uri  : string|null
Uri string
$username  : string|null
Username
$wwwAuth  : Header|null
WWW-Auth Header

Methods

__construct()  : mixed
Constructor
__toString()  : string
Render the header value string
create()  : Digest
Create digest
createDigestString()  : string
Create digest value
createFromHeader()  : Digest
Create digest from client header
createFromWwwAuth()  : Digest
Create digest from WWW-auth server header
getAlgorithm()  : string
Get the algorithm
getBody()  : string
Get the body
getClientNonce()  : string
Get the client nonce
getErrors()  : array<string|int, mixed>
Get errors
getMethod()  : string
Get the method
getNonce()  : string
Get the nonce
getNonceCount()  : string
Get the nonce count
getOpaque()  : string
Get the opaque
getPassword()  : string
Get the password
getQop()  : string
Get the QOP
getRealm()  : string
Get the realm
getUri()  : string
Get the URI
getUsername()  : string
Get the $username
getWwwAuth()  : Header
Get the WWW auth header
hasAlgorithm()  : bool
Has algorithm
hasBody()  : bool
Has body
hasClientNonce()  : bool
Has client nonce
hasErrors()  : bool
Has errors
hasMethod()  : bool
Has method
hasNonce()  : bool
Has nonce
hasNonceCount()  : bool
Has nonce count
hasOpaque()  : bool
Has opaque
hasPassword()  : bool
Has password
hasQop()  : bool
Has qop
hasRealm()  : bool
Has realm
hasUri()  : bool
Has URI
hasUsername()  : bool
Has $username
hasWwwAuth()  : bool
Has WWW auth header
isStale()  : bool
Is stale
isValid()  : bool
Is valid
setAlgorithm()  : Digest
Set the algorithm
setBody()  : Digest
Set the body
setClientNonce()  : Digest
Set the client nonce
setMethod()  : Digest
Set the method
setNonce()  : Digest
Set the nonce
setNonceCount()  : Digest
Set the nonce count
setOpaque()  : Digest
Set the opaque
setPassword()  : Digest
Set the password
setQop()  : Digest
Set the QOP
setRealm()  : Digest
Set the realm
setStale()  : Digest
Set stale flag
setUri()  : Digest
Set the URI
setUsername()  : Digest
Set the username
setWwwAuth()  : Digest
Set the WWW auth header

Constants

ALGO_MD5

Digest constants

public string ALGO_MD5 = 'MD5'

ALGO_MD5_SESS

public mixed ALGO_MD5_SESS = 'MD5-sess'

QOP_AUTH

public mixed QOP_AUTH = 'auth'

QOP_AUTH_INT

public mixed QOP_AUTH_INT = 'auth-int'

Properties

$algorithm

Algorithm

protected string $algorithm = self::ALGO_MD5

$body

Body

protected string|null $body = null

$clientNonce

Client nonce

protected string|null $clientNonce = null

$errors

Validation errors

protected array<string|int, mixed> $errors = []

$method

Method

protected string $method = 'GET'

$nonce

Nonce

protected string|null $nonce = null

$nonceCount

Nonce count

protected string|null $nonceCount = null

$opaque

Opaque

protected string|null $opaque = null

$password

Password

protected string|null $password = null

$qop

QOP

protected string|null $qop = null

$realm

Realm

protected string|null $realm = null

$stale

Stale flag

protected bool $stale = false

$uri

Uri string

protected string|null $uri = null

$username

Username

protected string|null $username = null

$wwwAuth

WWW-Auth Header

protected Header|null $wwwAuth = null

Methods

__construct()

Constructor

public __construct(string $realm, string $username, string $password, string $uri, string $nonce) : mixed

Instantiate the auth digest object

Parameters
$realm : string
$username : string
$password : string
$uri : string
$nonce : string

__toString()

Render the header value string

public __toString() : string
Return values
string

create()

Create digest

public static create(string $realm, string $username, string $password, string $uri, string $nonce) : Digest
Parameters
$realm : string
$username : string
$password : string
$uri : string
$nonce : string
Return values
Digest

createDigestString()

Create digest value

public createDigestString([Value $value = new Value() ]) : string
Parameters
$value : Value = new Value()
Return values
string

createFromHeader()

Create digest from client header

public static createFromHeader(string|Header $header, mixed $password) : Digest
Parameters
$header : string|Header
$password : mixed
Return values
Digest

createFromWwwAuth()

Create digest from WWW-auth server header

public static createFromWwwAuth(string|Header $wwwAuth, string $username, string $password, string $uri) : Digest
Parameters
$wwwAuth : string|Header
$username : string
$password : string
$uri : string
Tags
throws
Exception
Return values
Digest

getAlgorithm()

Get the algorithm

public getAlgorithm() : string
Return values
string

getBody()

Get the body

public getBody() : string
Return values
string

getClientNonce()

Get the client nonce

public getClientNonce() : string
Return values
string

getErrors()

Get errors

public getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMethod()

Get the method

public getMethod() : string
Return values
string

getNonce()

Get the nonce

public getNonce() : string
Return values
string

getNonceCount()

Get the nonce count

public getNonceCount() : string
Return values
string

getOpaque()

Get the opaque

public getOpaque() : string
Return values
string

getPassword()

Get the password

public getPassword() : string
Return values
string

getQop()

Get the QOP

public getQop() : string
Return values
string

getRealm()

Get the realm

public getRealm() : string
Return values
string

getUri()

Get the URI

public getUri() : string
Return values
string

getUsername()

Get the $username

public getUsername() : string
Return values
string

hasAlgorithm()

Has algorithm

public hasAlgorithm() : bool
Return values
bool

hasBody()

Has body

public hasBody() : bool
Return values
bool

hasClientNonce()

Has client nonce

public hasClientNonce() : bool
Return values
bool

hasErrors()

Has errors

public hasErrors() : bool
Return values
bool

hasMethod()

Has method

public hasMethod() : bool
Return values
bool

hasNonce()

Has nonce

public hasNonce() : bool
Return values
bool

hasNonceCount()

Has nonce count

public hasNonceCount() : bool
Return values
bool

hasOpaque()

Has opaque

public hasOpaque() : bool
Return values
bool

hasPassword()

Has password

public hasPassword() : bool
Return values
bool

hasQop()

Has qop

public hasQop() : bool
Return values
bool

hasRealm()

Has realm

public hasRealm() : bool
Return values
bool

hasUri()

Has URI

public hasUri() : bool
Return values
bool

hasUsername()

Has $username

public hasUsername() : bool
Return values
bool

hasWwwAuth()

Has WWW auth header

public hasWwwAuth() : bool
Return values
bool

isStale()

Is stale

public isStale() : bool
Return values
bool

isValid()

Is valid

public isValid() : bool
Return values
bool

setAlgorithm()

Set the algorithm

public setAlgorithm(string $algorithm) : Digest
Parameters
$algorithm : string
Return values
Digest

setBody()

Set the body

public setBody(string $body) : Digest
Parameters
$body : string
Return values
Digest

setClientNonce()

Set the client nonce

public setClientNonce(string $clientNonce) : Digest
Parameters
$clientNonce : string
Return values
Digest

setMethod()

Set the method

public setMethod(string $method) : Digest
Parameters
$method : string
Return values
Digest

setNonce()

Set the nonce

public setNonce(string $nonce) : Digest
Parameters
$nonce : string
Return values
Digest

setNonceCount()

Set the nonce count

public setNonceCount(string $nonceCount) : Digest
Parameters
$nonceCount : string
Return values
Digest

setOpaque()

Set the opaque

public setOpaque(string $opaque) : Digest
Parameters
$opaque : string
Return values
Digest

setPassword()

Set the password

public setPassword(string $password) : Digest
Parameters
$password : string
Return values
Digest

setQop()

Set the QOP

public setQop(string $qop) : Digest
Parameters
$qop : string
Return values
Digest

setRealm()

Set the realm

public setRealm(string $realm) : Digest
Parameters
$realm : string
Return values
Digest

setStale()

Set stale flag

public setStale([bool $stale = false ]) : Digest
Parameters
$stale : bool = false
Return values
Digest

setUri()

Set the URI

public setUri(string $uri) : Digest
Parameters
$uri : string
Return values
Digest

setUsername()

Set the username

public setUsername(string $username) : Digest
Parameters
$username : string
Return values
Digest

        
On this page

Search results