Inheritance: implements jose\SignerInterface, use trait Jose\Behaviour\HasKeyChecker, use trait Jose\Behaviour\HasJWAManager, use trait Jose\Behaviour\HasPayloadConverter
Beispiel #1
0
 /**
  * @param mixed                     $payload
  * @param \Jose\Object\JWKInterface $signature_key
  * @param array                     $protected_headers
  *
  * @return \Jose\Object\JWSInterface
  */
 private static function createJWSWithDetachedPayloadAndSign($payload, JWKInterface $signature_key, array $protected_headers = [], $headers = [])
 {
     $jws = self::createJWS($payload, true);
     $jws = $jws->addSignatureInformation($signature_key, $protected_headers, $headers);
     $complete_headers = array_merge($protected_headers, $headers);
     Assertion::keyExists($complete_headers, 'alg', 'No "alg" parameter set in the header');
     $signer = Signer::createSigner([$complete_headers['alg']]);
     $signer->sign($jws);
     return $jws;
 }
 /**
  * @param string[] $selected_algorithms
  *
  * @return \Jose\SignerInterface
  */
 public function createSigner(array $selected_algorithms)
 {
     $algorithms = $this->algorithm_manager->getSelectedAlgorithmMethods($selected_algorithms);
     return Signer::createSigner($algorithms);
 }