github.com/letsencrypt/boulder@v0.20251208.0/linter/lints/test/helpers.go (about) 1 package test 2 3 import ( 4 "encoding/pem" 5 "os" 6 "testing" 7 8 "github.com/zmap/zcrypto/x509" 9 10 "github.com/letsencrypt/boulder/test" 11 ) 12 13 func LoadPEMCRL(t *testing.T, filename string) *x509.RevocationList { 14 t.Helper() 15 file, err := os.ReadFile(filename) 16 test.AssertNotError(t, err, "reading CRL file") 17 block, rest := pem.Decode(file) 18 test.AssertEquals(t, block.Type, "X509 CRL") 19 test.AssertEquals(t, len(rest), 0) 20 crl, err := x509.ParseRevocationList(block.Bytes) 21 test.AssertNotError(t, err, "parsing CRL bytes") 22 return crl 23 }