Jose\Algorithm\KeyEncryption\KeyWrappingInterface::wrapKey PHP Method

wrapKey() public method

Encrypt the CEK.
public wrapKey ( Jose\Object\JWKInterface $key, string $cek, array $complete_headers, array &$additional_headers ) : string
$key Jose\Object\JWKInterface The key used to wrap the CEK
$cek string The CEK to encrypt
$complete_headers array The complete header of the JWT
$additional_headers array The complete header of the JWT
return string The encrypted CEK
    public function wrapKey(JWKInterface $key, $cek, array $complete_headers, array &$additional_headers);

Usage Example

Beispiel #1
0
 /**
  * @param array                                              $complete_headers
  * @param string                                             $cek
  * @param \Jose\Algorithm\KeyEncryption\KeyWrappingInterface $key_encryption_algorithm
  * @param \Jose\Object\JWKInterface                          $recipient_key
  * @param array                                              $additional_headers
  *
  * @return string
  */
 private function getEncryptedKeyFromKeyWrappingAlgorithm(array $complete_headers, $cek, Algorithm\KeyEncryption\KeyWrappingInterface $key_encryption_algorithm, Object\JWKInterface $recipient_key, &$additional_headers)
 {
     return $key_encryption_algorithm->wrapKey($recipient_key, $cek, $complete_headers, $additional_headers);
 }
KeyWrappingInterface