草庐IT

ParsePKIXPublicKey

全部标签

go - x509 Go 包 - ParsePKIXPublicKey 是 DER 还是 PEM?

我正在尝试获取rsa.PublicKey的对象,并执行了以下步骤:----BEGINRSAPUBLICKEY----....----ENDRSAPUBLICKEY----packagemainimport("crypto/rand""crypto/rsa""crypto/x509""encoding/pem""fmt""io/ioutil")funcmain(){key,err:=ioutil.ReadFile("./new_public.pem")iferr!=nil{fmt.Println(err.Error())}block,_:=pem.Decode([]byte(key))i

go - x509 Go 包 - ParsePKIXPublicKey 是 DER 还是 PEM?

我正在尝试获取rsa.PublicKey的对象,并执行了以下步骤:----BEGINRSAPUBLICKEY----....----ENDRSAPUBLICKEY----packagemainimport("crypto/rand""crypto/rsa""crypto/x509""encoding/pem""fmt""io/ioutil")funcmain(){key,err:=ioutil.ReadFile("./new_public.pem")iferr!=nil{fmt.Println(err.Error())}block,_:=pem.Decode([]byte(key))i