Emarref\Jwt\Algorithm\RsaSsaPkcs::ensureSupport PHP Method

ensureSupport() public method

public ensureSupport ( )
    public function ensureSupport()
    {
        if (!function_exists('openssl_sign')) {
            throw new \RuntimeException('Openssl is required to use RSA encryption.');
        }
        $supportedAlgorithms = openssl_get_md_methods(true);
        if (!in_array($this->getAlgorithm(), $supportedAlgorithms)) {
            throw new \RuntimeException('Algorithm "%s" is not supported on this system.', $this->getAlgorithm());
        }
    }