HumHub Documentation (unofficial)

HMAC
in package
implements MacAlgorithm

AbstractYes

Table of Contents

Interfaces

MacAlgorithm

Methods

allowedKeyTypes()  : array<string|int, string>
Returns the key types suitable for this algorithm (e.g. "oct", "RSA"...).
hash()  : string
Sign the input.
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
string

verify()

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
bool

getHashAlgorithm()

protected abstract getHashAlgorithm() : string
Return values
string

getKey()

protected getKey(JWK $key) : string
Parameters
$key : JWK
Tags
throws
InvalidArgumentException

if the key is invalid

Return values
string

        
On this page

Search results