예제 #1
0
파일: Dir.php 프로젝트: rwx-zwx-awx/jose
 /**
  * {@inheritdoc}
  */
 public function getCEK(JWKInterface $key, array $header)
 {
     if ('dir' !== $key->getKeyType()) {
         throw new \InvalidArgumentException('The key is not valid');
     }
     return Base64Url::decode($key->getValue('dir'));
 }
예제 #2
0
파일: RSA.php 프로젝트: rwx-zwx-awx/jose
 /**
  * @param JWKInterface $key
  */
 protected function checkKey(JWKInterface $key)
 {
     if ('RSA' !== $key->getKeyType()) {
         throw new \InvalidArgumentException('The key is not valid');
     }
 }
예제 #3
0
 /**
  * @param JWKInterface $key
  */
 protected function checkKey(JWKInterface $key)
 {
     if ('oct' !== $key->getKeyType() || null === $key->getValue('k')) {
         throw new \InvalidArgumentException('The key is not valid');
     }
 }
예제 #4
0
파일: ECDHES.php 프로젝트: rwx-zwx-awx/jose
 /**
  * @param JWKInterface $key
  * @param bool         $is_private
  */
 private function checkKey(JWKInterface $key, $is_private)
 {
     if ('EC' !== $key->getKeyType()) {
         throw new \RuntimeException("The key type must be 'EC'");
     }
     if (null === $key->getValue('d') && true === $is_private) {
         throw new \RuntimeException('The key must be private');
     }
 }