Example #1
0
 /**
  *
  * @see \JWX\JWE\KeyManagementAlgorithm::headerParameters()
  * @return JWTParameter[]
  */
 public function headerParameters()
 {
     return array_merge(parent::headerParameters(), array(AlgorithmParameter::fromAlgorithm($this), InitializationVectorParameter::fromString($this->_iv)));
 }
Example #2
0
File: JWE.php Project: sop/jwx
 /**
  * Decrypt content using given JWK.
  *
  * Key management and content encryption algorithms are determined from the
  * header.
  *
  * @param JWK $jwk JSON Web Key
  * @throws \RuntimeException If algorithm initialization fails
  * @return string Plaintext payload
  */
 public function decryptWithJWK(JWK $jwk)
 {
     $header = $this->header();
     $key_algo = KeyManagementAlgorithm::fromJWK($jwk, $header);
     $enc_algo = EncryptionAlgorithmFactory::algoByHeader($header);
     return $this->decrypt($key_algo, $enc_algo);
 }
Example #3
0
 /**
  *
  * @see \JWX\JWE\KeyManagementAlgorithm::headerParameters()
  * @return JWTParameter[]
  */
 public function headerParameters()
 {
     return array_merge(parent::headerParameters(), array(AlgorithmParameter::fromAlgorithm($this)));
 }
Example #4
0
 /**
  *
  * @see \JWX\JWE\KeyManagementAlgorithm::headerParameters()
  * @return JWTParameter[]
  */
 public function headerParameters()
 {
     return array_merge(parent::headerParameters(), array(AlgorithmParameter::fromAlgorithm($this), PBES2SaltInputParameter::fromString($this->_saltInput), new PBES2CountParameter($this->_count)));
 }