Nelson B wrote:
Philippe Camacho wrote:

I try to use SGN_Digest with the algorithm SEC_OID_PKCS1_RSA_ENCRYPTION but it fails: The error code given by PR_GetError is -8186 (Bad algorithm). I tried other algorithms but it still failed...
Which algorithm I am supposed to use?


Thanks for help.


A "digest" is a cryptographic hash, not a signature, and not encryption.
The OID you cite above is an OID for an encryption/signature algorithm,
not an OID for a hash algorithm.
You need to specify one of the following values:

SEC_OID_MD2
SEC_OID_MD5
SEC_OID_SHA1
SEC_OID_SHA256
SEC_OID_SHA384
SEC_OID_SHA512

See http://lxr.mozilla.org/security/source/security/nss/lib/util/secdig.c#95

Thank very much it works fine now!
_______________________________________________
mozilla-crypto mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-crypto

Reply via email to