Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support SM2 ? #226

Open
Nu1i opened this issue Jan 12, 2024 · 4 comments
Open

support SM2 ? #226

Nu1i opened this issue Jan 12, 2024 · 4 comments

Comments

@Nu1i
Copy link

Nu1i commented Jan 12, 2024

secp will be support sm2?

@jessepeterson
Copy link
Member

Sorry, what is sm2?

@Nu1i
Copy link
Author

Nu1i commented May 1, 2024

Sorry, what is sm2?

SM2 is an asymmetric encryption algorithm recognized by the National Cryptography Administration of China and is a type of ECC.
https://zh.wikipedia.org/zh-hans/SM2

@jessepeterson
Copy link
Member

@Nu1i hmm. That's seems tough. Where would you need the support? Like, issuing these certs? Or using them in the CMS/PKCS#7 exchanges? SM2/SM9 doesn't seem to be supported in the native Go stdlibs that makes it unlikely to support in these projects. But I'd defer to more knowledgeable folks like @hslatman.

@hslatman
Copy link
Contributor

hslatman commented May 2, 2024

If the (third party) SM2 implementation adheres to the interfaces provided by crypto, then the PKCS7 layer can likely be made to work to a certain extent. But I think issuing a certificate for an SM2 key won't (currently) work, as that currently only works for RSA keys, with messages encrypted to the public key. SCEP can work with ECDSA keys (and presumably, also other EC keys, such as SM2), but encryption then happens against the challenge password. This functionality is currently not supported in the scep package.

I don't have experience with SM2 in practice, so I can't tell if there's more to it. I did find out that https://github.com/xipki/xipki does seem to support it, though, so maybe that provides some insights. Might be limited to other protocols, and not SCEP, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants