This commit is contained in:
hailin 2025-06-13 21:58:25 +08:00
parent 60e3d8b873
commit 0a294da37e
1 changed files with 26 additions and 29 deletions

View File

@ -7,10 +7,8 @@ import (
"crypto/sha256" "crypto/sha256"
"crypto/x509" "crypto/x509"
"encoding/base64" "encoding/base64"
"encoding/json"
"encoding/pem" "encoding/pem"
"math/big" "math/big"
"time"
) )
var ( var (
@ -47,4 +45,3 @@ func ExportPublicKeyPEM() string {
pubKeyBytes, _ := x509.MarshalPKIXPublicKey(&privateKey.PublicKey) pubKeyBytes, _ := x509.MarshalPKIXPublicKey(&privateKey.PublicKey)
return string(pem.EncodeToMemory(&pem.Block{Type: "PUBLIC KEY", Bytes: pubKeyBytes})) return string(pem.EncodeToMemory(&pem.Block{Type: "PUBLIC KEY", Bytes: pubKeyBytes}))
} }