HumHub Documentation (unofficial)

JWK
in package
implements JsonSerializable

Table of Contents

Interfaces

JsonSerializable

Properties

$values  : array<string|int, mixed>

Methods

__construct()  : mixed
Creates a JWK object using the given values.
all()  : array<string|int, mixed>
Get all values stored in the JWK object.
createFromJson()  : JWK
Creates a JWK object using the given Json string.
get()  : null|mixed
Get the value with a specific key.
has()  : bool
Returns true if the JWK has the value identified by.
jsonSerialize()  : array<string|int, mixed>
Returns the values to be serialized.
thumbprint()  : string
Returns the thumbprint of the key.
toPublic()  : JWK
Returns the associated public key.

Properties

$values

private array<string|int, mixed> $values = []

Methods

__construct()

Creates a JWK object using the given values.

public __construct(array<string|int, mixed> $values) : mixed

The member "kty" is mandatory. Other members are NOT checked.

Parameters
$values : array<string|int, mixed>
Tags
throws
InvalidArgumentException

if the key parameter "kty" is missing

all()

Get all values stored in the JWK object.

public all() : array<string|int, mixed>
Return values
array<string|int, mixed>

Values of the JWK object

createFromJson()

Creates a JWK object using the given Json string.

public static createFromJson(string $json) : JWK
Parameters
$json : string
Tags
throws
InvalidArgumentException

if the data is not valid

Return values
JWK

get()

Get the value with a specific key.

public get(string $key) : null|mixed
Parameters
$key : string

The key

Tags
throws
InvalidArgumentException

if the key does not exist

Return values
null|mixed

has()

Returns true if the JWK has the value identified by.

public has(string $key) : bool
Parameters
$key : string

The key

Return values
bool

jsonSerialize()

Returns the values to be serialized.

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

thumbprint()

Returns the thumbprint of the key.

public thumbprint(string $hash_algorithm) : string
Parameters
$hash_algorithm : string
Tags
see
https://tools.ietf.org/html/rfc7638
throws
InvalidArgumentException

if the hashing function is not supported

Return values
string

toPublic()

Returns the associated public key.

public toPublic() : JWK

This method has no effect for:

  • public keys
  • shared keys
  • unknown keys.

Known keys are "oct", "RSA", "EC" and "OKP".

Return values
JWK
Loading…
On this page

Search results