HS256
extends HMAC
in package
FinalYes
Table of Contents
Methods
- allowedKeyTypes() : array<string|int, string>
- Returns the key types suitable for this algorithm (e.g. "oct", "RSA"...).
- hash() : string
- Sign the input.
- name() : string
- Returns the name of the algorithm.
- verify() : bool
- Verify the signature of data.
- getHashAlgorithm() : string
- getKey() : string
Methods
allowedKeyTypes()
Returns the key types suitable for this algorithm (e.g. "oct", "RSA"...).
public
allowedKeyTypes() : array<string|int, string>
Return values
array<string|int, string>hash()
Sign the input.
public
hash(JWK $key, string $input) : string
Parameters
- $key : JWK
-
The private key used to hash the data
- $input : string
-
The input
Return values
stringname()
Returns the name of the algorithm.
public
name() : string
Return values
stringverify()
Verify the signature of data.
public
verify(JWK $key, string $input, string $signature) : bool
Parameters
- $key : JWK
-
The private key used to hash the data
- $input : string
-
The input
- $signature : string
-
The signature to verify
Return values
boolgetHashAlgorithm()
protected
getHashAlgorithm() : string
Return values
stringgetKey()
protected
getKey(JWK $key) : string
Parameters
- $key : JWK