MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

PublicKey

MMO\oauth\keys · 1 symbol · generated 27 Oct 2026

class

PublicKey

PublicKey.php:13
class MMO\oauth\keys\PublicKey extends MMO\oauth\classes\aKey implements MMO\oauth\interfaces\iPublicKey
Namespace
MMO\oauth\keys
Extends
aKey
Implements
iPublicKey

Index

encrypt($data)Encrypt data using AES256.
FromJWK($jwk) staticParse a JSON Web key (JWK)
FromJWKs($jwks) staticParse a set of JWK keys
toPEM()Extract the public key as a PEM
verify($msg, $signature, $algorithm)Verify a signature with the message, key and method.
__construct($key)
__toString()

Methods7

encrypt($data)

PublicKey.php:106

Encrypt data using AES256.

function encrypt(string $data)
$datastring
returnsbase 64 encoded string

FromJWK($jwk)

staticPublicKey.php:30

Parse a JSON Web key (JWK)

static function FromJWK(array $jwk): static
$jwkarrayAn individual JWK
returnsstatic

FromJWKs($jwks)

staticPublicKey.php:62

Parse a set of JWK keys

static function FromJWKs(array $jwks): array
$jwksarrayThe JSON Web Key Set as an associative array
returnsarray

verify($msg, $signature, $algorithm)

PublicKey.php:97

Verify a signature with the message, key and method. Not all methods are symmetric, so we must have a separate verify and sign method.

function verify(string $msg, string $signature, ?string $algorithm = null): bool
$msgstringThe original message (header and body)
$signaturestringThe original signature
$algorithm = nullnull | string
returnsbool
Inherited members (4)
PropertiesDeclared byDescription
contentaKey
MethodsDeclared byDescription
FromFile($filename, $args)aKeyParse a key from a file
getContent()aKey
jsonSerialize()aKey