Francisco Puentes wrote:
Being a beginner with NSS, I need help :-(

I am trying to generate a RSA pair of keys with this code:

    NSS_Init("./rsa.db");
NSS_Init requires a pointer to a directory (which should already exist). You should check the error code coming back for NSS_Init. It's probably failing.

    SECKEYPublicKey*rsaPbKey=NULL;
SECKEYPrivateKey*rsaPrKey=SECKEY_CreateRSAPrivateKey(1024,&rsaPbKey,NULL);
Just a note: this will produce an ephemeral key (non-persistent). I can't tell if that's what you want from your code fragment or not.
    ...
    NSS_Shutdown();

But all seems to be wrong, rsaPrKey (and its partner) are always NULL.

What is wrong?



_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to