Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function getSupportedCompressionMethods()
 {
     return false === $this->isEncryptionSupportEnabled() ? [] : $this->encrypter->getSupportedCompressionMethods();
 }
 /**
  * @param string $payload
  * @param array  $protected_headers
  * @param array  $sender_key
  *
  * @return string
  */
 public function encrypt($payload, array $protected_headers, array $sender_key = [])
 {
     $sender_key = empty($sender_key) ? null : new JWK($sender_key);
     $instruction = new EncryptionInstruction($this->encryption_key, $sender_key);
     return $this->encrypter->encrypt($payload, [$instruction], JSONSerializationModes::JSON_COMPACT_SERIALIZATION, $protected_headers);
 }