ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SecretKeyRotation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
42{
46 private array $older_keys;
47
48 public function __construct(
49 private SecretKey $current_key,
51 ) {
52 $this->older_keys = $older_keys;
53 }
54
55 public function getAllKeys(): array
56 {
57 return array_merge([$this->current_key], $this->older_keys);
58 }
59
60 public function getOlderKeys(): array
61 {
62 return $this->older_keys;
63 }
64
65 public function getCurrentKey(): SecretKey
66 {
67 return $this->current_key;
68 }
69}
Key rotation can provide an extra layer of mitigation against an attacker discovering a secret key.
__construct(private SecretKey $current_key, SecretKey ... $older_keys)
Signatures are secured by the secret_key.
Definition: SecretKey.php:40