countSignatures() public method

Returns the number of signature associated with the JWS.
public countSignatures ( ) : integer
return integer
Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function sign(Object\JWSInterface &$jws)
 {
     $nb_signatures = $jws->countSignatures();
     for ($i = 0; $i < $nb_signatures; $i++) {
         $this->computeSignature($jws, $jws->getSignature($i));
     }
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function checkJWS(Object\JWSInterface $jws, $signature)
 {
     Assertion::integer($signature);
     Assertion::lessThan($signature, $jws->countSignatures());
     $checked_claims = $this->checkJWT($jws);
     $protected_headers = $jws->getSignature($signature)->getProtectedHeaders();
     $headers = $jws->getSignature($signature)->getHeaders();
     $this->checkHeaders($protected_headers, $headers, $checked_claims);
 }
Beispiel #3
0
 /**
  * @param \Jose\Object\JWSInterface $jws
  */
 private function checkSignatures(Object\JWSInterface $jws)
 {
     Assertion::greaterThan($jws->countSignatures(), 0, 'The JWS does not contain any signature.');
 }