Jose\Object\JWSInterface::getSignature PHP Method

getSignature() public method

public getSignature ( integer $id ) : Jose\Object\SignatureInterface
$id integer
return Jose\Object\SignatureInterface
    public function &getSignature($id);

Usage Example

示例#1
0
 /**
  * {@inheritdoc}
  */
 public function verify(Object\JWSInterface $jws, Object\JWKSetInterface $signature_key_set, $detached_payload = null)
 {
     Assertion::inArray($jws->getSignature(0)->getProtectedHeader('alg'), $this->getSupportedSignatureAlgorithms(), sprintf('The signature algorithm "%s" is not supported or not allowed.', $jws->getSignature(0)->getProtectedHeader('alg')));
     $index = null;
     $this->verifier->verifyWithKeySet($jws, $signature_key_set, $detached_payload, $index);
     Assertion::notNull($index, 'JWS signature(s) verification failed.');
     $this->checker_manager->checkJWS($jws, $index);
     return $index;
 }