Thanks, thats what i get for being lazy, for testing i was just using a
small key, i just changed it to my 4096 key and it's working..
Where am i going wrong here?
char* message = "Hello World";
if(RSA_sign(NID_md5, (unsigned char*) message, strlen(message),
signature, &slen, private_key) != 1) {
The problem is that your RSA key is very small. A 256-bit RSA key can only
sign up to 32 bytes. 11 bytes are lost due to PKCS1 padding. A raw MD5
signature is 5 bytes. Add to that the fact that your key isn't quite 256
bits (it's about 248) and that an X509 signature has overhead, and you hit
the limit.
A typical signature is 36 bytes. Add 11 bytes for PKCS padding and you get
47 bytes, or 376 bits. So a 256-bit RSA key is not going to cut it.
DS
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]