Jose\KeyConverter\KeyConverter::loadFromKey PHP 메소드

loadFromKey() 공개 정적인 메소드

public static loadFromKey ( string $key, null | string $password = null ) : array
$key string
$password null | string
리턴 array
    public static function loadFromKey($key, $password = null)
    {
        try {
            return self::loadKeyFromDER($key, $password);
        } catch (\Exception $e) {
            return self::loadKeyFromPEM($key, $password);
        }
    }

Usage Example

예제 #1
0
 /**
  * {@inheritdoc}
  */
 public static function createFromKey($key, $password = null, array $additional_values = [])
 {
     $values = KeyConverter::loadFromKey($key, $password);
     $values = array_merge($values, $additional_values);
     return new JWK($values);
 }