The format='OpenSSH' parameter in Crypto.PublicKey.RSA.export_key when used with a private key exports the public key instead. The code extracts only the public key parameters and writes them to bytes from what I understand.
The current doc says "Only suitable for public keys", which I think does not convey what could happen if someone were to use a private key anyhow. It does not throw an error either. So I believe it would make sense to document this behavior.
The format='OpenSSH' parameter in Crypto.PublicKey.RSA.export_key when used with a private key exports the public key instead. The code extracts only the public key parameters and writes them to bytes from what I understand.
The current doc says "Only suitable for public keys", which I think does not convey what could happen if someone were to use a private key anyhow. It does not throw an error either. So I believe it would make sense to document this behavior.