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:----GzHIwN/uOuG4/1gSO1ztLRsgFv1Dg9Svkd0aOCgjwJYL2GUjkFhg9x4p7doNrb+bwH8xS6mmTfSWrqq9FQQOqF4dCvUlJifBmLVPJ0fGOhLk/kWuE933nhKvN/bGjKPGPT5US+xdrQ70CI3Y+1lRWFO3GhhYNrunx0V+uNGUiyargOuuQgEs7HiQPbCtCbIqoLwPzX2Znt6PkdEeovF8QVGseAP5jnYOF91GvX87oSAwKk5T8dejf4EoNoxdmSSXaNKuBB5M5mgtXj3SOe+S3NMw8YytMtftmZAZgQlvhCirsY2O+x8tTs+tsTSkAg44vgiuQ5St5YsBsP/chLHasgXrn6Z6Uz2pw7lrjGV0G1H3BVMPHWFkMGSGs0X7BcUOUUKzSPzS7CMXe5F+ObA2lR6zSk8KLfqL/B8oeAeLLu0qfZ9RIwWSLvUcfcjjkJfHknavHIFzjfxzHlwOEglYiVEN5YU8xXPTHBN1He3tXTy6v3vJmIa3lu03Um404A0nS7r6YkWmDn3fr7sbDclmkcATa8vwAOhOYnVjaXkXNTT3upBqGjMFMCFXQpmSQPV/XdIOLmiRrfIF1vy7yOqOw06ERWIZEYxaeIjWpuddsARLVE22o4Vqwh7WK7E//T/2a/ZVSHrfkvRAWwQ8p/wTfKMpyblSKjKfJmNhi4jcx/g=----ATTACHMENT:----ODAzMjI5NzAzMzg2MTg1NiA1ODM4MjI2NTY5OTY4NjQyIDU4NTk0NTUxMjc1MDAxNg==