(t testing.TB, path string, typ string, contents []byte)
| 57 | } |
| 58 | |
| 59 | func writePEM(t testing.TB, path string, typ string, contents []byte) { |
| 60 | t.Helper() |
| 61 | |
| 62 | f, err := os.Create(path) |
| 63 | require.NoError(t, err) |
| 64 | defer f.Close() |
| 65 | |
| 66 | err = pem.Encode(f, &pem.Block{ |
| 67 | Type: typ, |
| 68 | Bytes: contents, |
| 69 | }) |
| 70 | require.NoError(t, err) |
| 71 | } |
| 72 | |
| 73 | func WriteCertificate(t testing.TB, c tls.Certificate, certPath, keyPath string) { |
| 74 | require.Len(t, c.Certificate, 1, "expecting 1 certificate") |
no test coverage detected