How to store ECDSA private key in Go

前端 未结 3 1079
鱼传尺愫
鱼传尺愫 2021-02-01 06:23

I am using the ecdsa.GenerateKey method to generate a private/public key pair in Go. I would like to store the private key in a file on the users computer, and load

3条回答
  •  情书的邮戳
    2021-02-01 06:38

    I believe the standard format for those keys is to use the X.509 ASN.1 DER representation. See http://golang.org/pkg/crypto/x509/#MarshalECPrivateKey and http://golang.org/pkg/crypto/x509/#ParseECPrivateKey.

提交回复
热议问题