(t *testing.T, name string)
| 232 | } |
| 233 | |
| 234 | func makeChain(t *testing.T, name string) []*x509.Certificate { |
| 235 | t.Helper() |
| 236 | |
| 237 | certChain := make([]*x509.Certificate, 0) |
| 238 | |
| 239 | rest, err := os.ReadFile(name) |
| 240 | if err != nil { |
| 241 | t.Fatalf("os.ReadFile(%v) failed %v", name, err) |
| 242 | } |
| 243 | for len(rest) > 0 { |
| 244 | var block *pem.Block |
| 245 | block, rest = pem.Decode(rest) |
| 246 | c, err := x509.ParseCertificate(block.Bytes) |
| 247 | if err != nil { |
| 248 | t.Fatalf("ParseCertificate error %v", err) |
| 249 | } |
| 250 | t.Logf("Parsed Cert sub = %v iss = %v", c.Subject, c.Issuer) |
| 251 | certChain = append(certChain, c) |
| 252 | } |
| 253 | return certChain |
| 254 | } |
| 255 | |
| 256 | func loadCRL(t *testing.T, path string) *CRL { |
| 257 | crl, err := ReadCRLFile(path) |
no test coverage detected