Re: using an embedded private key

2007-07-10 Thread John T. Cox
Jim, Well now isn't that kind of obvious. I feel like such a dunce now. My excuse is the 12 hour days since Saturday. Thanks! On 7/10/07, Jim Fox <[EMAIL PROTECTED]> wrote: > > PEM_read_bio_RSAPrivateKey() returns a BIO *, not a EVP_PKEY *. So, I > am passing the wrong argument type when I ca

Re: using an embedded private key

2007-07-10 Thread Jim Fox
PEM_read_bio_RSAPrivateKey() returns a BIO *, not a EVP_PKEY *. So, I am passing the wrong argument type when I call EVP_PKEY_get1_RSA(). Did I use the wrong call, or am I missing a call? PEM_read_bio_RSAPrivateKey retuns an (RSA*) and you're done. You don't need or want the call to EVP_PKEY

Re: using an embedded private key

2007-07-10 Thread John T. Cox
This has hit the list a couple of times and I seem to making great progress thanks a lot to Jim. I believe I am now in the process of compiling and I have one final compile issue left. PEM_read_bio_RSAPrivateKey() returns a BIO *, not a EVP_PKEY *. So, I am passing the wrong argument type when I

Re: using an embedded private key

2007-07-05 Thread John T. Cox
Jim, Thanks again for pointing in the right direction! I really appreciate the help!! On 7/5/07, Jim Fox <[EMAIL PROTECTED]> wrote: > > Yes, my data is less than 128 bytes. I ran across that when I was > doing my original research and saw the approach you recommend for > larger files. > > So f

Re: using an embedded private key

2007-07-05 Thread Jim Fox
Yes, my data is less than 128 bytes. I ran across that when I was doing my original research and saw the approach you recommend for larger files. So for a small file, do I have the methodology correct? Yes. Didn't try the code, but it's the right approach. Jim

Re: using an embedded private key

2007-07-05 Thread John T. Cox
Jim, Yes, my data is less than 128 bytes. I ran across that when I was doing my original research and saw the approach you recommend for larger files. So for a small file, do I have the methodology correct? Thanks! On 7/5/07, Jim Fox <[EMAIL PROTECTED]> wrote: > > I grabbed "Network Security

Re: using an embedded private key

2007-07-05 Thread Jim Fox
I grabbed "Network Security with OpenSSL" on Safari and have been reading the relevant sections. That's a useful book. If I understand correctly, to read an external file, decrypt it using an internal private key and write the decrypted out to internal data, I would do: Is your file real

Re: using an embedded private key

2007-07-05 Thread John T. Cox
You've been very helpful Jim. I grabbed "Network Security with OpenSSL" on Safari and have been reading the relevant sections. If I understand correctly, to read an external file, decrypt it using an internal private key and write the decrypted out to internal data, I would do: void fn(char *inf

Re: using an embedded private key

2007-07-04 Thread Jim Fox
Does anyone know of an alternative for populating EVP_PKEY * that emulates what load_key() does? load_key() is complicated only because it deals with lots of types of files and formats. Presumably you already know the format and location of your key. Just use pkey = PEM_read_bio_Pr

Re: using an embedded private key

2007-07-04 Thread John T. Cox
Jim, Thanks! I looked through the BIO calls. But, I obviously missed that one. Does anyone know of an alternative for populating EVP_PKEY * that emulates what load_key() does? TIA On 7/3/07, Jim Fox <[EMAIL PROTECTED]> wrote: > > So my questions are, how do I replicate what load_key() to pop

Re: using an embedded private key

2007-07-03 Thread Jim Fox
So my questions are, how do I replicate what load_key() to populate pkey (EVP_PKEY *)? And, are they any data functions that can be used to replace what the BIO functions do for files? The BIO routines work with strings as well as with files. BIO *rbio; rbio = BIO_new_mem_buf(str,

using an embedded private key

2007-07-03 Thread John T. Cox
Hi everyone, First I will admit being new to the list. I am trying to solve a technical problem and I believe I have one last piece to resolve. I know that from the command line I can duplicate what I need to do using the commands: openssl rsautil -encrypt -inkey pub.key etc openssl rsautil -d