MCPcopy Create free account
hub / github.com/prometheus/common / EncodeKey

Function EncodeKey

config/generate.go:46–53  ·  view source on GitHub ↗
(w io.Writer, priv *rsa.PrivateKey)

Source from the content-addressed store, hash-verified

44}
45
46func EncodeKey(w io.Writer, priv *rsa.PrivateKey) error {
47 b, err := x509.MarshalPKCS8PrivateKey(priv)
48 if err != nil {
49 return fmt.Errorf("failed to marshal private key: %v", err)
50 }
51
52 return pem.Encode(w, &pem.Block{Type: "PRIVATE KEY", Bytes: b})
53}
54
55var serialNumber *big.Int
56

Callers 1

writeCertificateAndKeyFunction · 0.85

Calls 1

EncodeMethod · 0.65

Tested by

no test coverage detected