MCPcopy Index your code
hub / github.com/cortexproject/cortex / WriteCACertificate

Method WriteCACertificate

integration/ca/ca.go:62–69  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

60}
61
62func (ca *CA) WriteCACertificate(path string) error {
63 derBytes, err := x509.CreateCertificate(rand.Reader, ca.cert, ca.cert, ca.key.Public(), ca.key)
64 if err != nil {
65 return err
66 }
67
68 return writeExclusivePEMFile(path, "CERTIFICATE", 0644, derBytes)
69}
70
71func (ca *CA) WriteCertificate(template *x509.Certificate, certPath string, keyPath string) error {
72 key, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader)

Callers 5

testSingleBinaryEnvFunction · 0.80
TestRulerAlertmanagerTLSFunction · 0.80
TestGetConsulConfigFunction · 0.80
setupCertificatesFunction · 0.80

Calls 1

writeExclusivePEMFileFunction · 0.85

Tested by 5

testSingleBinaryEnvFunction · 0.64
TestRulerAlertmanagerTLSFunction · 0.64
TestGetConsulConfigFunction · 0.64
setupCertificatesFunction · 0.64