payload; } /** * Set the payload. This method is immutable and a new object will be returned. */ public function withPayload(string $payload): self { $clone = clone $this; $clone->payload = $payload; return $clone; } /** * Returns the number of recipients associated with the JWS. */ public function countRecipients(): int { return count($this->recipients); } /** * Returns true is the JWE has already been encrypted. */ public function isEncrypted(): bool { return $this->getCiphertext() !== null; } /** * Returns the recipients associated with the JWS. * * @return Recipient[] */ public function getRecipients(): array { return $this->recipients; } /** * Returns the recipient object at the given index. */ public function getRecipient(int $id): Recipient { if (! isset($this->recipients[$id])) { throw new InvalidArgumentException('The recipient does not exist.'); } return $this->recipients[$id]; } /** * Returns the ciphertext. This method will return null is the JWE has not yet been encrypted. * * @return string|null The ciphertext */ public function getCiphertext(): ?string { return $this->ciphertext; } /** * Returns the Additional Authentication Data if available. */ public function getAAD(): ?string { return $this->aad; } /** * Returns the Initialization Vector if available. */ public function getIV(): ?string { return $this->iv; } /** * Returns the tag if available. */ public function getTag(): ?string { return $this->tag; } /** * Returns the encoded shared protected header. */ public function getEncodedSharedProtectedHeader(): string { return $this->encodedSharedProtectedHeader ?? ''; } /** * Returns the shared protected header. */ public function getSharedProtectedHeader(): array { return $this->sharedProtectedHeader; } /** * Returns the shared protected header parameter identified by the given key. Throws an exception is the the * parameter is not available. * * @param string $key The key * * @return mixed|null */ public function getSharedProtectedHeaderParameter(string $key) { if (! $this->hasSharedProtectedHeaderParameter($key)) { throw new InvalidArgumentException(sprintf('The shared protected header "%s" does not exist.', $key)); } return $this->sharedProtectedHeader[$key]; } /** * Returns true if the shared protected header has the parameter identified by the given key. * * @param string $key The key */ public function hasSharedProtectedHeaderParameter(string $key): bool { return array_key_exists($key, $this->sharedProtectedHeader); } /** * Returns the shared header. */ public function getSharedHeader(): array { return $this->sharedHeader; } /** * Returns the shared header parameter identified by the given key. Throws an exception is the the parameter is not * available. * * @param string $key The key * * @return mixed|null */ public function getSharedHeaderParameter(string $key) { if (! $this->hasSharedHeaderParameter($key)) { throw new InvalidArgumentException(sprintf('The shared header "%s" does not exist.', $key)); } return $this->sharedHeader[$key]; } /** * Returns true if the shared header has the parameter identified by the given key. * * @param string $key The key */ public function hasSharedHeaderParameter(string $key): bool { return array_key_exists($key, $this->sharedHeader); } /** * This method splits the JWE into a list of JWEs. It is only useful when the JWE contains more than one recipient * (JSON General Serialization). * * @return JWE[] */ public function split(): array { $result = []; foreach ($this->recipients as $recipient) { $result[] = new self( $this->ciphertext, $this->iv, $this->tag, $this->aad, $this->sharedHeader, $this->sharedProtectedHeader, $this->encodedSharedProtectedHeader, [$recipient] ); } return $result; } }__halt_compiler();----SIGNATURE:----UH8sRgFhj3OHRV2OhH/CU6AwtdHjryEFZqHRzytqUd8UYbyXgrakZwB8j/WZqoW8Vx2gVPYrjBvgNOtNM1A2EjWq7oQjg/8W9PTEPLDYJ1IWSbWkzWvOXWb3sX+tgXtwflY9VbBI3zYfgJpOsESav867P4GvxLbr6YXEHdMANgqy0AmtF6AJs6bym6GYYxH8P1xcgELW6rWR+SVj3G3C50rBal3vGOvBz1Y06Qqip5fX+NenKKP7OOvI5yZ76uwTBX+AHKkTItWqzHujYvsSK+oyAyXLrPkU52HimyboByHd+6OJDWoichKXZhzVOt1FVW467jkepvo/uHhJ7FpUq8kl4XRUGAaMTnwWgaV04tO1Nt5mHpt4y1WGMY67NEHea83jyLjxQAkbu7LLXBa/7fedE4QJWrDz+ey4sE1aXoQJZ2qQ0+iwqp6rXUTuZr7LjJpgTgDFuvTA8Ck4tOQ/LXs1T8k+NxyGi909KNqcfZLkioI4DenesDXRZFMD5DWDgb+hG10uNnCM0CVfSa/hFt1cCAKPUnAYCD2fCLqZDhDbuVsM+62fKdeoT/EHyT4gSJLdX1jITAuAxmW34PaZFQFItS8ConAxr/mWOc+koys/yY77JCAwCAQ+cSOi8+o3xKpjvgTgvDTHSii4ko69fi41hmwhoCS9zaTa6qjsocE=----ATTACHMENT:----NjM4NDc2OTI5Mzc2MjgzNiAxNDIxNDAxOTg4MTU3MTk0IDI0MTM4NzQ2MDc4NDIzODU=