<?php
 declare(strict_types=1); namespace Jose\Component\Encryption; use InvalidArgumentException; use function array_key_exists; use function sprintf; final readonly class Recipient { public function __construct( private array $header, private ?string $encryptedKey ) { } public function getHeader(): array { return $this->header; } public function getHeaderParameter(string $key) { if (! $this->hasHeaderParameter($key)) { throw new InvalidArgumentException(sprintf('The header "%s" does not exist.', $key)); } return $this->header[$key]; } public function hasHeaderParameter(string $key): bool { return array_key_exists($key, $this->header); } public function getEncryptedKey(): ?string { return $this->encryptedKey; } } 