PHP Class Emarref\Jwt\Encryption\Symmetric

Inheritance: extends AbstractEncryption, implements Emarref\Jwt\Encryption\EncryptionInterface
Datei anzeigen Open project: emarref/jwt

Public Methods

Method Description
__construct ( Emarref\Jwt\Algorithm\SymmetricInterface $algorithm )
encrypt ( string $value ) : string
getSecret ( ) : string
setSecret ( string $secret )
timingSafeEquals ( string $safe, string $user ) : boolean A timing safe equals comparison.
verify ( string $value, string $signature ) : boolean

Method Details

__construct() public method

public __construct ( Emarref\Jwt\Algorithm\SymmetricInterface $algorithm )
$algorithm Emarref\Jwt\Algorithm\SymmetricInterface

encrypt() public method

public encrypt ( string $value ) : string
$value string
return string

getSecret() public method

public getSecret ( ) : string
return string

setSecret() public method

public setSecret ( string $secret )
$secret string

timingSafeEquals() public method

A timing safe equals comparison.
See also: http://blog.ircmaxell.com/2014/11/its-all-about-time.html
public timingSafeEquals ( string $safe, string $user ) : boolean
$safe string The internal (safe) value to be checked
$user string The user submitted (unsafe) value
return boolean True if the two strings are identical.

verify() public method

public verify ( string $value, string $signature ) : boolean
$value string
$signature string
return boolean