Jose\KeyConverter\KeyConverter::loadFromKeyFile PHP Method

loadFromKeyFile() public static method

public static loadFromKeyFile ( string $file, null | string $password = null ) : array
$file string
$password null | string
return array
    public static function loadFromKeyFile($file, $password = null)
    {
        $content = file_get_contents($file);
        return self::loadFromKey($content, $password);
    }

Usage Example

示例#1
0
 /**
  * {@inheritdoc}
  */
 public static function createFromKeyFile($file, $password = null, array $additional_values = [])
 {
     $values = KeyConverter::loadFromKeyFile($file, $password);
     $values = array_merge($values, $additional_values);
     return new JWK($values);
 }