Lcobucci\JWT\Signer\Rsa::validateKey PHP Method

validateKey() private method

Raise an exception when the key type is not the expected type
private validateKey ( resource $key )
$key resource
    private function validateKey($key)
    {
        if ($key === false) {
            throw new InvalidArgumentException('It was not possible to parse your key, reason: ' . openssl_error_string());
        }
        $details = openssl_pkey_get_details($key);
        if (!isset($details['key']) || $details['type'] !== OPENSSL_KEYTYPE_RSA) {
            throw new InvalidArgumentException('This key is not compatible with RSA signatures');
        }
    }