RSA: conditionally throw BadPasswordException