MCPcopy
hub / github.com/jsha/minica / readCert

Function readCert

main.go:100–108  ·  view source on GitHub ↗
(certContents []byte)

Source from the content-addressed store, hash-verified

98}
99
100func readCert(certContents []byte) (*x509.Certificate, error) {
101 block, _ := pem.Decode(certContents)
102 if block == nil {
103 return nil, fmt.Errorf("no PEM found")
104 } else if block.Type != "CERTIFICATE" {
105 return nil, fmt.Errorf("incorrect PEM type %s", block.Type)
106 }
107 return x509.ParseCertificate(block.Bytes)
108}
109
110func makeIssuer(keyFile, certFile string, alg x509.PublicKeyAlgorithm) error {
111 key, err := makeKey(keyFile, alg)

Callers 1

getIssuerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…