countKeys() public method

public countKeys ( ) : integer
return integer
 /**
  * @param \Jose\JWTCreatorInterface    $jwt_creator
  * @param string                       $issuer
  * @param string                       $signature_algorithm
  * @param \Jose\Object\JWKSetInterface $signature_key_set
  */
 public function enableSignedResponsesSupport(JWTCreatorInterface $jwt_creator, $issuer, $signature_algorithm, JWKSetInterface $signature_key_set)
 {
     Assertion::string($issuer);
     Assertion::inArray($signature_algorithm, $jwt_creator->getSupportedSignatureAlgorithms());
     Assertion::greaterThan($signature_key_set->countKeys(), 0, 'The signature key set must have at least one key.');
     $this->setJWTCreator($jwt_creator);
     $this->setIssuer($issuer);
     $this->signature_key_set = $signature_key_set;
     $this->signature_algorithm = $signature_algorithm;
 }
 /**
  * JWTAccessTokenManager constructor.
  *
  * @param \Jose\JWTCreatorInterface    $jwt_creator
  * @param \Jose\JWTLoaderInterface     $jwt_loader
  * @param string                       $signature_algorithm
  * @param \Jose\Object\JWKSetInterface $signature_key_set
  * @param string                       $issuer
  * @param string                       $key_encryption_algorithm
  * @param string                       $content_encryption_algorithm
  * @param \Jose\Object\JWKSetInterface $key_encryption_key_set
  */
 public function __construct(JWTCreatorInterface $jwt_creator, JWTLoaderInterface $jwt_loader, $signature_algorithm, JWKSetInterface $signature_key_set, $key_encryption_algorithm, $content_encryption_algorithm, JWKSetInterface $key_encryption_key_set, $issuer)
 {
     Assertion::string($signature_algorithm);
     Assertion::string($key_encryption_algorithm);
     Assertion::string($content_encryption_algorithm);
     Assertion::greaterThan($signature_key_set->countKeys(), 0, 'The signature key set must have at least one key.');
     Assertion::greaterThan($key_encryption_key_set->countKeys(), 0, 'The encryption key set must have at least one key.');
     Assertion::inArray($signature_algorithm, $jwt_creator->getSupportedSignatureAlgorithms());
     Assertion::inArray($key_encryption_algorithm, $jwt_creator->getSupportedKeyEncryptionAlgorithms());
     Assertion::inArray($content_encryption_algorithm, $jwt_creator->getSupportedContentEncryptionAlgorithms());
     $this->signature_algorithm = $signature_algorithm;
     $this->key_encryption_algorithm = $key_encryption_algorithm;
     $this->content_encryption_algorithm = $content_encryption_algorithm;
     $this->setIssuer($issuer);
     $this->signature_key_set = $signature_key_set;
     $this->key_encryption_key_set = $key_encryption_key_set;
     $this->setJWTCreator($jwt_creator);
     $this->setJWTLoader($jwt_loader);
 }
 /**
  * {@inheritdoc}
  */
 public function enableEncryptedRequestObjectSupport(JWKSetInterface $key_encryption_key_set, $require_encryption)
 {
     Assertion::boolean($require_encryption);
     Assertion::true($this->isRequestObjectSupportEnabled(), 'Request object support must be enabled first.');
     Assertion::greaterThan($key_encryption_key_set->countKeys(), 0, 'The encryption key set must have at least one key.');
     $this->require_encryption = $require_encryption;
     $this->key_encryption_key_set = $key_encryption_key_set;
 }
 /**
  * {@inheritdoc}
  */
 public function enableEncryptionSupport(JWKSetInterface $encryption_key_set)
 {
     Assertion::greaterThan($encryption_key_set->countKeys(), 0, 'The encryption key set must have at least one key.');
     $this->encryption_key_set = $encryption_key_set;
 }
Example #5
0
 /**
  * @param \Jose\Object\JWKSetInterface $jwk_set
  */
 private function checkJWKSet(Object\JWKSetInterface $jwk_set)
 {
     Assertion::greaterThan($jwk_set->countKeys(), 0, 'There is no key in the key set.');
 }