Re: Reading private key from Memory Buffer.

2008-10-01 Thread Dan Ribe
Thanks guys, Removing the semi colon fixes the problem ! Cheers :) On Thu, Oct 2, 2008 at 3:46 AM, Kelly, Tom <[EMAIL PROTECTED]> wrote: > > > David Schwartz wrote: > >> "09dirkd+sRoXWShF8ctVVb4B1PAFTOBEa8diickehnAyEq6KhzLWpQqhqCnylETw\r\n" >>> "Drys2uVaAzmRhS6tGJ2fdwPnlSLJrQbHuP938Bkyx

Re: Reading private key from Memory Buffer.

2008-10-01 Thread Kelly, Tom
David Schwartz wrote: "09dirkd+sRoXWShF8ctVVb4B1PAFTOBEa8diickehnAyEq6KhzLWpQqhqCnylETw\r\n" "Drys2uVaAzmRhS6tGJ2fdwPnlSLJrQbHuP938BkyxNhdYN8drfqb\r\n"; You appear to have an extra ";" here ---^ But that should give you a compilation error. "-END RSA PRIV

Re: Reading private key from Memory Buffer.

2008-10-01 Thread Patrick Patterson
Hi Dan: Dan Ribe wrote: > Hi, > > I am trying to read the private key from the memory buffer (code snippet > below), But PEM_read_bio_PrivateKey() always returns an error : OpenSSL > error: error:0906D06C:PEM routines:PEM_read_bio:no start line > > Can anyone please point out what I am doing wro

RE: Reading private key from Memory Buffer.

2008-10-01 Thread David Schwartz
> "09dirkd+sRoXWShF8ctVVb4B1PAFTOBEa8diickehnAyEq6KhzLWpQqhqCnylETw\r\n" > > "Drys2uVaAzmRhS6tGJ2fdwPnlSLJrQbHuP938BkyxNhdYN8drfqb\r\n"; > > You appear to have an extra ";" here ---^ > But that should give you a compilation error. > > > "-END RSA PRIVATE KEY

Re: Reading private key from Memory Buffer.

2008-10-01 Thread Goetz Babin-Ebell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dan Ribe wrote: | Thanks Tom for the help. Hello Dan, | | It seems that there is some problem with the private key which I am | passing. With your key or newly generated key this logic works fine. Now | the error which I am getting is like : | | OpenS

Re: Reading private key from Memory Buffer.

2008-10-01 Thread Kelly, Tom
Dan Ribe wrote: Thanks Tom for the help. It seems that there is some problem with the private key which I am passing. With your key or newly generated key this logic works fine. Now the error which I am getting is like : OpenSSL error: error:0906D066:PEM routines:PEM_read_bio:bad end line An

Re: Reading private key from Memory Buffer.

2008-10-01 Thread Dan Ribe
Thanks Tom for the help. It seems that there is some problem with the private key which I am passing. With your key or newly generated key this logic works fine. Now the error which I am getting is like : OpenSSL error: error:0906D066:PEM routines:PEM_read_bio:bad end line And last lines of my k

Re: Reading private key from Memory Buffer.

2008-10-01 Thread Kelly, Tom
Hmmm. Here's my example program (derived from yours). Without the "\r\n" at the end of the lines, I get the same error you do. With the code as below, it works fine: $ cc -o readkey readkey.c -lcrypto $ ./readkey Success $ #include #include char *key = "-BEGIN RSA PRIVATE KEY-\r\n

Re: Reading private key from Memory Buffer.

2008-10-01 Thread Dan Ribe
Tom, Tried your suggestion, but it is not working ! Any other clues on this ? Thanks much, Dan On Wed, Oct 1, 2008 at 7:04 PM, Kelly, Tom <[EMAIL PROTECTED]> wrote: > > > Dan Ribe wrote: > >> Hi, >> >> I am trying to read the private key from the memory buffer (code snippet >> below), But PEM_

Re: Reading private key from Memory Buffer.

2008-10-01 Thread Kelly, Tom
Dan Ribe wrote: Hi, I am trying to read the private key from the memory buffer (code snippet below), But PEM_read_bio_PrivateKey() always returns an error : OpenSSL error: error:0906D06C:PEM routines:PEM_read_bio:no start line Can anyone please point out what I am doing wrong here. I am prett