Beispiel #1
0
 /**
  * @param \Jose\JWKInterface|string|array $data
  */
 public function __construct($data)
 {
     parent::__construct();
     if ($data instanceof JWKInterface) {
         $this->loadJWK($data->getValues());
     } elseif (is_array($data)) {
         $this->loadJWK($data);
     } elseif (is_string($data)) {
         $this->loadPEM($data);
     } else {
         throw new \InvalidArgumentException('Unsupported input');
     }
 }
 /**
  * @param string             $kid The key ID
  * @param \Jose\JWKInterface $jwk A JWK object
  *
  * @return $this
  */
 public function loadKeyFromJWK($kid, JWKInterface $jwk)
 {
     $this->loadKeyFromValues($kid, $jwk->getValues());
     return $this;
 }