2
0

gen-sm2-keys.sh 359 B

12345678910111213141516
  1. #!/bin/sh
  2. for key in root ca server client
  3. do
  4. openssl genpkey -algorithm sm2 > ${key}-sm2-priv.pem
  5. openssl pkey -in ${key}-sm2-priv.pem -outform DER -out ${key}-sm2-priv.der
  6. openssl pkey -in ${key}-sm2-priv.pem -outform PEM -pubout -out ${key}-sm2-key.pem
  7. openssl pkey -in ${key}-sm2-priv.pem -outform DER -pubout -out ${key}-sm2-key.der
  8. done