TYPO3 CMS  TYPO3_6-2
Auth_OpenID_CryptUtil Class Reference

Static Public Member Functions

static getBytes ($num_bytes)
 
static randomString ($length, $population=null)
 
static constEq ($s1, $s2)
 

Detailed Description

Definition at line 26 of file CryptUtil.php.

Member Function Documentation

◆ constEq()

static Auth_OpenID_CryptUtil::constEq (   $s1,
  $s2 
)
static

Definition at line 108 of file CryptUtil.php.

References $result.

Referenced by Auth_OpenID_Association\checkMessageSignature().

◆ getBytes()

static Auth_OpenID_CryptUtil::getBytes (   $num_bytes)
static

Get the specified number of random bytes.

Attempts to use a cryptographically secure (not predictable) source of randomness if available. If there is no high-entropy randomness source available, it will fail. As a last resort, for non-critical systems, define Auth_OpenID_RAND_SOURCE as null, and the code will fall back on a pseudo-random number generator.

Parameters
int$num_bytesThe length of the return value
Returns
string $bytes random bytes

Definition at line 40 of file CryptUtil.php.

References E_USER_ERROR.

Referenced by Auth_OpenID_Signatory\createAssociation(), Auth_OpenID_MathLibrary\rand(), and randomString().

◆ randomString()

static Auth_OpenID_CryptUtil::randomString (   $length,
  $population = null 
)
static

Produce a string of length random bytes, chosen from chrs. If $chrs is null, the resulting string may contain any characters.

Parameters
integer$lengthThe length of the resulting randomly-generated string
string$chrsA string of characters from which to choose to build the new string
Returns
string $result A string of randomly-chosen characters from $chrs

Definition at line 80 of file CryptUtil.php.

References E_USER_ERROR, and getBytes().

Referenced by Auth_OpenID_mkNonce().