This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

PK11_GenerateKeyPair how can i make an ecc key pair.

more options

怎样写ECC 密钥对模板。 我不怎么会填参数。 或者SM2.

怎样写ECC 密钥对模板。 我不怎么会填参数。 或者SM2.

Chosen solution

Hello,

I am sorry, I can't understand Mandarin, but based on Google translate, looks like you are looking for a sample code that explains how to create a keypair using NSS functions. You can check this sample code from MDN - Sample code for PK11_generateKeyPair.

Please check this and let us know if you were successful in generating a keypair.

谢谢

Read this answer in context 👍 2

All Replies (2)

more options

Chosen Solution

Hello,

I am sorry, I can't understand Mandarin, but based on Google translate, looks like you are looking for a sample code that explains how to create a keypair using NSS functions. You can check this sample code from MDN - Sample code for PK11_generateKeyPair.

Please check this and let us know if you were successful in generating a keypair.

谢谢

more options

Thank you for the same, but i have alread solved the question.Yesteday I meant that the NSS is enable for ecc with an NSS_ENABLE_ECC flag, but I didn't find an ECC params to fill the PK11_GenerateKeyPair argv. Now i have searched the website and found that file named "\nss\cmd\certutil\keystuff.c" told me how to fix the params for ECC not RSA.

Now my problem is turned to be how to make a SM2 arg. SM2 is a kind of ECC. It is a chinese official standard.