Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Copyright (c) 2002-2003 Richard Heyes Copyright 2011-2017 Horde LLC (http://www.horde.org/) This code is based on the original code contained in the PEAR Auth_SASL package (v0.5.1): $Id: DigestMD5.php 294702 2010-02-07 16:03:55Z cweiske $

Copyright: 2002-2003 Richard Heyes
Copyright: 2011-2017 Horde LLC
License: http://www.horde.org/licenses/lgpl21 LGPL 2.1
File Size: 189 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Horde_Imap_Client_Auth_DigestMD5:: (5 methods):
  __construct()
  __toString()
  __get()
  _parseChallenge()
  _getCnonce()


Class: Horde_Imap_Client_Auth_DigestMD5  - X-Ref

Provides the code needed to authenticate via the DIGEST-MD5 SASL mechanism
(defined in RFC 2831). This method has been obsoleted by RFC 6331, but
still is in use on legacy servers.

__construct($id, $pass, $challenge, $hostname, $service)   X-Ref
Generate the Digest-MD5 response.

param: string $id         Authentication id (username).
param: string $pass       Password.
param: string $challenge  The digest challenge sent by the server.
param: string $hostname   The hostname of the machine connecting to.
param: string $service    The service name (e.g. 'imap', 'pop3').

__toString()   X-Ref
Cooerce to string.

return: string  The digest response (not base64 encoded).

__get($name)   X-Ref
Return specific digest response directive.

return: mixed  Requested directive, or null if it does not exist.

_parseChallenge($challenge)   X-Ref
Parses and verifies the digest challenge.

param: string $challenge  The digest challenge
return: array  The parsed challenge as an array with directives as keys.

_getCnonce()   X-Ref
Creates the client nonce for the response

return: string  The cnonce value.