Namshi\JOSE\Signer\OpenSSL\PublicKey::getKeyResource PHP Метод

getKeyResource() защищенный Метод

Converts a string representation of a key into an OpenSSL resource.
protected getKeyResource ( string | resource $key, string $password = null ) : resource
$key string | resource
$password string
Результат resource OpenSSL key resource
    protected function getKeyResource($key, $password = null)
    {
        if (is_resource($key)) {
            return $key;
        }
        $resource = openssl_pkey_get_public($key) ?: openssl_pkey_get_private($key, $password);
        if ($resource === false) {
            throw new RuntimeException('Could not read key resource: ' . openssl_error_string());
        }
        return $resource;
    }