PHP Class Namshi\JOSE\SimpleJWS

Inheritance: extends JWS
Mostrar archivo Open project: namshi/jose Class Usage Examples

Public Methods

Method Description
__construct ( array $header = [], $encryptionEngine = 'OpenSSL' ) Constructor.
isExpired ( ) : boolean Checks whether the token is expired based on the 'exp' value.
isValid ( resource | string $key, string $algo = null ) : boolean Checks that the JWS has been signed with a valid private key by verifying it with a public $key and the token is not expired.
setPayload ( array $payload ) Sets the payload of the current JWS with an issued at value in the 'iat' property.

Method Details

__construct() public method

Constructor.
See also: http://php.net/manual/en/function.json-encode.php
See also: http://php.net/manual/en/jsonserializable.jsonserialize.php
See also: https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41#section-4 }
public __construct ( array $header = [], $encryptionEngine = 'OpenSSL' )
$header array An associative array of headers. The value can be any type accepted by json_encode or a JSON serializable object

isExpired() public method

it.
public isExpired ( ) : boolean
return boolean

isValid() public method

Checks that the JWS has been signed with a valid private key by verifying it with a public $key and the token is not expired.
public isValid ( resource | string $key, string $algo = null ) : boolean
$key resource | string
$algo string The algorithms this JWS should be signed with. Use it if you want to restrict which algorithms you want to allow to be validated.
return boolean

setPayload() public method

Sets the payload of the current JWS with an issued at value in the 'iat' property.
public setPayload ( array $payload )
$payload array