PHP Class Namshi\JOSE\JWS

Inheritance: extends Namshi\JOSE\JWT
Mostra file Open project: namshi/jose Class Usage Examples

Protected Properties

Property Type Description
$encodedSignature
$encryptionEngine
$isSigned
$signature
$supportedEncryptionEngines

Public Methods

Method Description
__construct ( array $header = [], string $encryptionEngine = 'OpenSSL' ) Constructor.
getEncodedSignature ( ) : string Returns the base64 encoded signature.
getSignature ( ) : string Returns the signature representation of the JWS.
getTokenString ( ) : string Returns the string representing the JWT.
isSigned ( ) : boolean Checks whether the JSW has already been signed.
load ( string $jwsTokenString, boolean $allowUnsecure = false, Namshi\JOSE\Base64\Encoder $encoder = null, string $encryptionEngine = 'OpenSSL' ) : JWS Creates an instance of a JWS from a JWT.
setEncodedSignature ( string $encodedSignature ) : JWS Sets the base64 encoded signature.
sign ( resource | string $key, $password = null ) : string Signs the JWS signininput.
verify ( resource | string $key, string $algo = null ) : boolean Verifies that the internal signin input corresponds to the encoded signature previously stored (@see JWS::load).

Protected Methods

Method Description
getSigner ( ) : Namshi\JOSE\Signer\SignerInterface Returns the signer responsible to encrypting / decrypting this JWS.

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 = [], string $encryptionEngine = 'OpenSSL' )
$header array An associative array of headers. The value can be any type accepted by json_encode or a JSON serializable object
$encryptionEngine string }

getEncodedSignature() public method

Returns the base64 encoded signature.
public getEncodedSignature ( ) : string
return string

getSignature() public method

Returns the signature representation of the JWS.
public getSignature ( ) : string
return string

getSigner() protected method

Returns the signer responsible to encrypting / decrypting this JWS.
protected getSigner ( ) : Namshi\JOSE\Signer\SignerInterface
return Namshi\JOSE\Signer\SignerInterface

getTokenString() public method

Returns the string representing the JWT.
public getTokenString ( ) : string
return string

isSigned() public method

Checks whether the JSW has already been signed.
public isSigned ( ) : boolean
return boolean

load() public static method

Creates an instance of a JWS from a JWT.
public static load ( string $jwsTokenString, boolean $allowUnsecure = false, Namshi\JOSE\Base64\Encoder $encoder = null, string $encryptionEngine = 'OpenSSL' ) : JWS
$jwsTokenString string
$allowUnsecure boolean
$encoder Namshi\JOSE\Base64\Encoder
$encryptionEngine string
return JWS

setEncodedSignature() public method

Sets the base64 encoded signature.
public setEncodedSignature ( string $encodedSignature ) : JWS
$encodedSignature string
return JWS

sign() public method

Signs the JWS signininput.
public sign ( resource | string $key, $password = null ) : string
$key resource | string
return string

verify() public method

Verifies that the internal signin input corresponds to the encoded signature previously stored (@see JWS::load).
public verify ( 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

Property Details

$encodedSignature protected_oe property

protected $encodedSignature

$encryptionEngine protected_oe property

protected $encryptionEngine

$isSigned protected_oe property

protected $isSigned

$signature protected_oe property

protected $signature

$supportedEncryptionEngines protected_oe property

protected $supportedEncryptionEngines