openssl: SM2 private key cannot produce valid signatures

-----BEGIN PRIVATE KEY-----
MEECAQAwEwYHKoZIzj0CAQYIKoEcz1UBgi0EJzAlAgEBBCD////+////////////////cgPfayHG
BStTu/QJOdVBIg==
-----END PRIVATE KEY-----

Above private key cannot produce valid digital signatures:

openssl pkey -in sm2_bad.key -pubout > sm2_bad.key.pub
openssl pkeyutl -inkey sm2_bad.key -in /etc/lsb-release -rawin -sign -pkeyopt sm2_id:Alice > sm2_bad.sig
openssl pkeyutl -inkey sm2_bad.key.pub -pubin -in /etc/lsb-release -rawin -verify -pkeyopt sm2_id:Alice -sigfile sm2_bad.sig
Signature Verification Failure

@InfoHunter What does the spec say about key generation?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 54 (53 by maintainers)

Commits related to this issue

Most upvoted comments

!!! There are translations??? I haven’t seen that NISSTC column before…

That was exactly what I did last year to push an RFC draft to IETF…to let others understand the specs.

I was checking this again, was something similar ever working in 1.1.1?

I think @InfoHunter is right – this doesn’t appear to be in 1.1.1.

So just ignore any of my “breaking change” talk.

Sorry for the noise on that part.