public function toCompactJSON($id)
{
$recipient = $this->getRecipient($id);
$this->checkHasNoAAD();
$this->checkHasSharedProtectedHeaders();
$this->checkRecipientHasNoHeaders($id);
return sprintf('%s.%s.%s.%s.%s', $this->getEncodedSharedProtectedHeaders(), Base64Url::encode(null === $recipient->getEncryptedKey() ? '' : $recipient->getEncryptedKey()), Base64Url::encode(null === $this->getIV() ? '' : $this->getIV()), Base64Url::encode($this->getCiphertext()), Base64Url::encode(null === $this->getTag() ? '' : $this->getTag()));
}