Re: PEM_read PrivateKey gives illegal seek

2008-08-13 Thread Matthias Barmeier
Hi Tim, after understanding what happens I found and understand FAQ. But if it is part of the FAQ why not putting a hint on the relevant man pages, Maybe after doing this this item is no FAQ any more ;). Ciao Matthias Matthias Barmeier wrote: Hi, ok, sorry for not understanding what

Re: PEM_read PrivateKey gives illegal seek

2008-08-12 Thread Tim Hudson
Matthias Barmeier wrote: Hi, ok, sorry for not understanding what happens. The call OpenSSL_add_all_algorithms() was missing. After adding it everything seems to work perfect. Shouldn't this be mentioned on the man page of the PEM functions ? It is not PEM specific - it applies to anything

PEM_read PrivateKey gives illegal seek

2008-08-11 Thread Matthias Barmeier
Hi, I generated a x509 certificate. When I try to read the private key with PEM_read_PrivateKey I always get NULL as return value and when calling perror I get an Illegal seek. Here is my code: FILE *pemKeyFile; EVP_PKEY *privKey; pemKeyFile = fopen

RE: PEM_read PrivateKey gives illegal seek

2008-08-11 Thread David Schwartz
Hi, I generated a x509 certificate. When I try to read the private key with PEM_read_PrivateKey I always get NULL as return value and when calling perror I get an Illegal seek. Here is my code: FILE *pemKeyFile; EVP_PKEY *privKey; pemKeyFile = fopen

RE: PEM_read PrivateKey gives illegal seek

2008-08-11 Thread Matthias Barmeier
... Can anyone tell me why this does not work ? Most likely the file you're reading doesn't contain a private key in a format that PEM_read_PriveKey likes. But the best way to tell is to use more sensible error output code. For example, call ERR_print_errors_fp(stderr). The 'perror'

Re: PEM_read PrivateKey gives illegal seek

2008-08-11 Thread Matthias Barmeier
Hi, You should you generate an X509 certificate and then try to read the private key with PEM_read_PrivateKey. What does the key that you are trying to load look like? Could it be that you are reading in the certificate in place of the key? Also, I don't know much about perror, butOpenSSL has

RE: PEM_read PrivateKey gives illegal seek

2008-08-11 Thread David Schwartz
Hi, You should you generate an X509 certificate and then try to read the private key with PEM_read_PrivateKey. What does the key that you are trying to load look like? Could it be that you are reading in the certificate in place of the key? Also, I don't know much about perror,

Re: PEM_read PrivateKey gives illegal seek

2008-08-11 Thread Matthias Barmeier
Hi, ok, sorry for not understanding what happens. The call OpenSSL_add_all_algorithms() was missing. After adding it everything seems to work perfect. Shouldn't this be mentioned on the man page of the PEM functions ? Ciao Matthias