NoneJwk
in package
implements
Jwk
Represents a JWK implementation for "alg": "none".
Table of Contents
Interfaces
- Jwk
- Represents a JSON Web Key.
Methods
- __construct() : mixed
- __sleep() : array<string|int, mixed>
- getAlgorithm() : string|null
- Gets the algorithm of this key, equivalent to the "alg" field.
- getId() : string|null
- Gets the ID of this key, equivalent to the "kid" field.
- getPublicKey() : Jwk|null
- Gets an instance of Jwk that ensures it is backed by a public key.
- jsonSerialize() : mixed
- sign() : string
- Signs data using this key. Only available if it is backed by a private key.
- verify() : bool
- Verifies data against this key.
Methods
__construct()
public
__construct([string|null $id = null ]) : mixed
Parameters
- $id : string|null = null
-
Key ID.
__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>getAlgorithm()
Gets the algorithm of this key, equivalent to the "alg" field.
public
getAlgorithm() : string|null
Return values
string|nullgetId()
Gets the ID of this key, equivalent to the "kid" field.
public
getId() : string|null
Return values
string|nullgetPublicKey()
Gets an instance of Jwk that ensures it is backed by a public key.
public
getPublicKey() : Jwk|null
Will return null if it is impossible to create a public representation of this key.
Return values
Jwk|nulljsonSerialize()
public
jsonSerialize() : mixed
Attributes
- #[ReturnTypeWillChange]
sign()
Signs data using this key. Only available if it is backed by a private key.
public
sign(string $data[, string|null $algo = null ]) : string
Parameters
- $data : string
-
Data to be signed.
- $algo : string|null = null
-
JWK algorithm to sign the data with.
Return values
stringverify()
Verifies data against this key.
public
verify(string $data, string $signature[, string|null $algo = null ]) : bool
Parameters
- $data : string
-
Data to be verified.
- $signature : string
-
Signature of the data.
- $algo : string|null = null
-
JWK algorithm to verify the data with.