RSA: fix `generateKey`, some minor fixes, add key components test