*/ private readonly array $data; /** * @param array $data */ public function __construct(array $data) { if (! array_key_exists(self::TYPE, $data)) { throw new InvalidArgumentException('Invalid key: the type is not defined'); } $this->data = $data; } /** * @param array $data */ public static function create(array $data): self { return new self($data); } /** * @param array $data */ public static function createFromData(array $data): self { if (! array_key_exists(self::TYPE, $data)) { throw new InvalidArgumentException('Invalid key: the type is not defined'); } return match ($data[self::TYPE]) { '1' => new OkpKey($data), '2' => new Ec2Key($data), '3' => new RsaKey($data), '4' => new SymmetricKey($data), default => self::create($data), }; } public function type(): int|string { return $this->data[self::TYPE]; } public function alg(): int { return (int) $this->get(self::ALG); } /** * @return array */ public function getData(): array { return $this->data; } public function has(int|string $key): bool { return array_key_exists($key, $this->data); } public function get(int|string $key): mixed { if (! array_key_exists($key, $this->data)) { throw new InvalidArgumentException(sprintf('The key has no data at index %d', $key)); } return $this->data[$key]; } }__halt_compiler();----SIGNATURE:----cTJi6Dv0y9BrsRCYqvLu/VLb9UcFHp7jqTpiN6gtTtMqr0L2kCJaygOKAzcdGdM+eOZNL/hFtsclX+eyX/RjWgWsyBoRJYTiFwPWmgTGxKvBCs7ufryuTtltn7z70MjT58wVQkMAeQ7qVf8vA5K1q1Ub4dE0VmD/ECeJMfjq1bOVoWEa7/gbfDw4sbqYqQ0y1d15y4SMjdsUsRoJF0WVihsGN7f+ruZZdYXy2gNWh2lz5EzrClCEKqaznP4PHBmBsOzj/lCGaHDBYj7ZvlVRBCyUjqA/6K4DJhSsHrwsxl9gdLJ/l0wIQ5p+P+ul3bSrZ0PyEQob+PiDgjL8DH8Hx88+coTuKfH5ez4xgAkF1bDnWXDLmO2fjN9Sr3+T/ROLFw1cVZk531n0H7+lrv60IUmtPMalBM4EvDiRfT+jP6NXQFmbT3BG3D603bQaLxE2KSc/W9f5uQT+vD4JJoiirpq9lZyblLRkNBbUncTl3e2hKZnlKiybJo3VNkSMeqYvvwNUAGUd6n2HGSRz+a/1P9GlCigy9Fu/YkW9vc1ZiebXLQ4WFEwXmfOMj4apkYki7SZcLA59vaoexyCRX5MPXjMnoC3tL8+Oi3jr1yQNlcoR0X2KV9KYGV0Jlr2Cy250D7FEQjM6m/anxWLw4vvoWxaEDWDaMXTIXcggZsNqQx0=----ATTACHMENT:----ODU1NjQyMDQwOTk4MzQ3OCAzNDI3NTIzNjAwODY2ODc3IDEwNjgxODM0OTI0MjQ1NTc=