Excuse me if my questions appear too obviuos for you.
This is my problem:
- I have my private key.
- I have a string.
- I have to sign this string with my private key using md5.
- I have made a small C program to do this.

I put here some lines of it:

<...>
  EVP_MD_CTX  ctx;
  EVP_PKEY *pkey;
<...>
  pkey = PEM_read_PrivateKey(fp,NULL,NULL,NULL);
  EVP_SignInit(&ctx, EVP_md5()); 
  EVP_SignUpdate(&ctx, data, strlen(data));
  err = EVP_SignFinal (&ctx, buf, &slen, pkey);
<...>

Is this correct?
Just another question.
Having the same data (and obviously the same private key), the 
signature (buf in the example), has to be always the same?

-- 
Cosimo Vagarini
[EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to