learner
learner

Reputation: 45

How to Load puttygen RSA keys using Cryptolib in C++?

I have API's to load the Private and public keys, developed using Cryptolib.

    CryptoPP::RSA::PrivateKey
    CryptoPP::RSA::PublicKey

When I try to load the RSA(Private and Public) keys generated by puttygen , load functions crashes. Is it possible load the keys generated by Puttygen, in Cryptolib?

Upvotes: 0

Views: 170

Answers (1)

Cinder Biscuits
Cinder Biscuits

Reputation: 5261

Crypto++ uses the PCKS #8 Private Key Information Standard for private keys and the X.509 Public key standard format as specified in their documentation. Puttygen uses the PuTTY format. These are not easily converted using C++, but it is possible. It's a lot easier just to export to OpenSSH format from within puttygen though.

If you still want to do it programmatically, you can use the Chilkat CKSshKey library which was developed for just this purpose. You can see an example of converting a PuTTY private key to OpenSSH PEM (which is what Crypto++ will read) here.

Upvotes: 1

Related Questions