move rsa param verification to shared function