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

Function EncodeKey

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

Source from the content-addressed store, hash-verified

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

Callers 1

writeCertificateAndKeyFunction · 0.85

Calls 1

EncodeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…