Hi,

I have a private key generated by openssl (openssl genrsa –out key.pem 1024) in PEM format. But I don’t know how I can use this key in crypto++ or how to convert a private key from OpenSSL to a format which I can use in crypto++.

I would like to use this code for creating signature file:

 

            FileSource privFile(privFilename, true);

            RSASSA_PKCS1v15_SHA_Signer priv(privFile);

            FileSource f(messageFilename, true, new SignerFilter(NullRNG(), priv, new HexEncoder(new FileSink(signatureFilename))));

 

I tried to convert PEM to binary form.   However, I always received “BER decode error” when I tried to sign a file. Can somebody help me?

 

Thanks very much,

Patrik

Reply via email to