Semantic MediaWiki and related extensions
Static Public Member Functions | List of all members
SMW\Utils\HmacSerializer Class Reference

Static Public Member Functions

static encode ( $data, $key=null, $algo='md5')
 
static decode ( $data, $key=null, $algo='md5')
 
static serialize ( $data, $key=null, $algo='md5')
 
static unserialize ( $data, $key=null, $algo='md5')
 
static compress ( $data, $key=null, $algo='md5')
 
static uncompress ( $data, $key=null, $algo='md5')
 

Detailed Description

Serialize/encode a data element with a hmac hash to verify that the output are in fact the same as the input data, minimizing an attack vector on injecting malicious content when retrieving the data from en external systems (like a cache).

The shared secret key to generate the HMAC is by default MediaWiki's $wgSecretKey.

GNU GPL v2+

Since
3.0
Author
mwjames

Member Function Documentation

◆ compress()

static SMW\Utils\HmacSerializer::compress (   $data,
  $key = null,
  $algo = 'md5' 
)
static
Since
3.0
Parameters
mixed$data
string$key
string$algo= 'md5'
Returns
string|boolean

◆ decode()

static SMW\Utils\HmacSerializer::decode (   $data,
  $key = null,
  $algo = 'md5' 
)
static
Since
3.0
Parameters
mixed$data
string$key
string$algo= 'md5'
Returns
string|boolean

◆ encode()

static SMW\Utils\HmacSerializer::encode (   $data,
  $key = null,
  $algo = 'md5' 
)
static
Since
3.0
Parameters
mixed$data
string$key
string$algo= 'md5'
Returns
string|boolean

◆ serialize()

static SMW\Utils\HmacSerializer::serialize (   $data,
  $key = null,
  $algo = 'md5' 
)
static
Since
3.0
Parameters
mixed$data
string$key
string$algo= 'md5'
Returns
string|boolean

◆ uncompress()

static SMW\Utils\HmacSerializer::uncompress (   $data,
  $key = null,
  $algo = 'md5' 
)
static
Since
3.0
Parameters
string$data
string$key
string$algo= 'md5'
Returns
mixed|boolean

◆ unserialize()

static SMW\Utils\HmacSerializer::unserialize (   $data,
  $key = null,
  $algo = 'md5' 
)
static
Since
3.0
Parameters
string$data
string$key
string$algo= 'md5'
Returns
mixed|boolean

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy