Digest
in package
HTTP auth digest class
Tags
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
stringcreate()
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
DigestcreateDigestString()
Create digest value
public
createDigestString([Value $value = new Value() ]) : string
Parameters
- $value : Value = new Value()
Return values
stringcreateFromHeader()
Create digest from client header
public
static createFromHeader(string|Header $header, mixed $password) : Digest
Parameters
- $header : string|Header
- $password : mixed
Return values
DigestcreateFromWwwAuth()
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
Return values
DigestgetAlgorithm()
Get the algorithm
public
getAlgorithm() : string
Return values
stringgetBody()
Get the body
public
getBody() : string
Return values
stringgetClientNonce()
Get the client nonce
public
getClientNonce() : string
Return values
stringgetErrors()
Get errors
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>getMethod()
Get the method
public
getMethod() : string
Return values
stringgetNonce()
Get the nonce
public
getNonce() : string
Return values
stringgetNonceCount()
Get the nonce count
public
getNonceCount() : string
Return values
stringgetOpaque()
Get the opaque
public
getOpaque() : string
Return values
stringgetPassword()
Get the password
public
getPassword() : string
Return values
stringgetQop()
Get the QOP
public
getQop() : string
Return values
stringgetRealm()
Get the realm
public
getRealm() : string
Return values
stringgetUri()
Get the URI
public
getUri() : string
Return values
stringgetUsername()
Get the $username
public
getUsername() : string
Return values
stringgetWwwAuth()
Get the WWW auth header
public
getWwwAuth() : Header
Return values
HeaderhasAlgorithm()
Has algorithm
public
hasAlgorithm() : bool
Return values
boolhasBody()
Has body
public
hasBody() : bool
Return values
boolhasClientNonce()
Has client nonce
public
hasClientNonce() : bool
Return values
boolhasErrors()
Has errors
public
hasErrors() : bool
Return values
boolhasMethod()
Has method
public
hasMethod() : bool
Return values
boolhasNonce()
Has nonce
public
hasNonce() : bool
Return values
boolhasNonceCount()
Has nonce count
public
hasNonceCount() : bool
Return values
boolhasOpaque()
Has opaque
public
hasOpaque() : bool
Return values
boolhasPassword()
Has password
public
hasPassword() : bool
Return values
boolhasQop()
Has qop
public
hasQop() : bool
Return values
boolhasRealm()
Has realm
public
hasRealm() : bool
Return values
boolhasUri()
Has URI
public
hasUri() : bool
Return values
boolhasUsername()
Has $username
public
hasUsername() : bool
Return values
boolhasWwwAuth()
Has WWW auth header
public
hasWwwAuth() : bool
Return values
boolisStale()
Is stale
public
isStale() : bool
Return values
boolisValid()
Is valid
public
isValid() : bool
Return values
boolsetAlgorithm()
Set the algorithm
public
setAlgorithm(string $algorithm) : Digest
Parameters
- $algorithm : string
Return values
DigestsetBody()
Set the body
public
setBody(string $body) : Digest
Parameters
- $body : string
Return values
DigestsetClientNonce()
Set the client nonce
public
setClientNonce(string $clientNonce) : Digest
Parameters
- $clientNonce : string
Return values
DigestsetMethod()
Set the method
public
setMethod(string $method) : Digest
Parameters
- $method : string
Return values
DigestsetNonce()
Set the nonce
public
setNonce(string $nonce) : Digest
Parameters
- $nonce : string
Return values
DigestsetNonceCount()
Set the nonce count
public
setNonceCount(string $nonceCount) : Digest
Parameters
- $nonceCount : string
Return values
DigestsetOpaque()
Set the opaque
public
setOpaque(string $opaque) : Digest
Parameters
- $opaque : string
Return values
DigestsetPassword()
Set the password
public
setPassword(string $password) : Digest
Parameters
- $password : string
Return values
DigestsetQop()
Set the QOP
public
setQop(string $qop) : Digest
Parameters
- $qop : string
Return values
DigestsetRealm()
Set the realm
public
setRealm(string $realm) : Digest
Parameters
- $realm : string
Return values
DigestsetStale()
Set stale flag
public
setStale([bool $stale = false ]) : Digest
Parameters
- $stale : bool = false
Return values
DigestsetUri()
Set the URI
public
setUri(string $uri) : Digest
Parameters
- $uri : string
Return values
DigestsetUsername()
Set the username
public
setUsername(string $username) : Digest
Parameters
- $username : string
Return values
DigestsetWwwAuth()
Set the WWW auth header
public
setWwwAuth(Header $wwwAuth) : Digest
Parameters
- $wwwAuth : Header