Key Management (JWK)
<?php
// Check if the key has a parameter.
$jwk->has('kty');
// Retrieve the key parameter.
$jwk->get('kty');
// Retrieve all key parameters.
$jwk->all();
// Calculate the thumbprint of the key. Acceptable hash algorithms are those returned by the PHP function "hash_algos".
$jwk->thumbprint('sha256');
// If the key is a private key (RSA, EC, OKP), it can be converted into public:
$public_key = $jwk->toPublic();
// The JWK object can be serialized into JSON
json_encode($jwk);Generate A New Key
Octet String
RSA Key Pair
Elliptic Curve Key Pair
Octet Key Pair
None Key
Create Key From External Sources
From Values
From A Key File
From A PKCS#12 Certificate
From A X.509 Certificate
Last updated
Was this helpful?