RSA: auto-detect public keys vs private keys

Fixes #132