MCPcopy
hub / github.com/hyperledger/fabric / readPemFile

Function readPemFile

protoutil/signeddata_test.go:171–183  ·  view source on GitHub ↗
(file string)

Source from the content-addressed store, hash-verified

169}
170
171func readPemFile(file string) ([]byte, error) {
172 bytes, err := readFile(file)
173 if err != nil {
174 return nil, errors.Wrapf(err, "reading from file %s failed", file)
175 }
176
177 b, _ := pem.Decode(bytes)
178 if b == nil {
179 return nil, errors.Errorf("no pem content for file %s", file)
180 }
181
182 return bytes, nil
183}

Callers 1

Calls 2

readFileFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected