PHP Class Namshi\JOSE\SimpleJWS

Inheritance: extends JWS
Afficher le fichier Open project: namshi/jose Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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 méthode

it.
public isExpired ( ) : boolean
Résultat boolean

isValid() public méthode

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.
Résultat boolean

setPayload() public méthode

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