On Tue, Apr 18, 2006 at 01:41:36PM +0200, Hanzel Patrik wrote: > 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?
Standard format to save the private key is PKCS-8 and crypto++ can handle it. On OpenSSL side, "openssl pkcs8 -nocrypt -outform DER" might save it that way Vadym Fedyukovych
