Commit 4631df82 authored by pengjun's avatar pengjun Committed by vipwzw

#334 fix linter error

parent abdb9668
......@@ -30,19 +30,15 @@ func CreateCertificateToMem(template, parent *sm2.Certificate, key csp.Key) (cer
func CreateCertificateToPem(FileName string, template, parent *sm2.Certificate, key csp.Key) error {
pk := key.(*csp.SM2PrivateKey).PrivKey
var err error
pub, _ := template.PublicKey.(*sm2.PublicKey)
var puk sm2.PublicKey
puk.Curve = sm2.P256Sm2()
puk.X = pub.X
puk.Y = pub.Y
_, err = sm2.CreateCertificateToPem(FileName, template, parent, &puk, pk)
if err != nil {
return err
}
_, err := sm2.CreateCertificateToPem(FileName, template, parent, &puk, pk)
return nil
return err
}
// ParseX509CertificateToSm2 解析x509格式为sm2格式证书
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment