ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
HMACSigningKeyGenerator.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
33 {
34  public function __construct(
35  private Algorithm $algorithm
36  ) {
37  }
38 
39  public function generate(SecretKey $secret_key, Salt $salt): SigningKey
40  {
41  return new SigningKey(hash_hmac($this->algorithm->getName(), $salt->get(), $secret_key->get(), false));
42  }
43 }
Signatures are secured by the secret_key.
Definition: SecretKey.php:39
The salt is combined with the secret key to derive a unique key for distinguishing different contexts...
Definition: Salt.php:37