NewCRL constructs new CRL from the provided byte array.
(b []byte)
| 72 | |
| 73 | // NewCRL constructs new CRL from the provided byte array. |
| 74 | func NewCRL(b []byte) (*CRL, error) { |
| 75 | crl, err := parseRevocationList(b) |
| 76 | if err != nil { |
| 77 | return nil, fmt.Errorf("fail to parse CRL: %v", err) |
| 78 | } |
| 79 | crlExt, err := parseCRLExtensions(crl) |
| 80 | if err != nil { |
| 81 | return nil, fmt.Errorf("fail to parse CRL extensions: %v", err) |
| 82 | } |
| 83 | crlExt.rawIssuer, err = extractCRLIssuer(b) |
| 84 | if err != nil { |
| 85 | return nil, fmt.Errorf("fail to extract CRL issuer failed err= %v", err) |
| 86 | } |
| 87 | return crlExt, nil |
| 88 | } |
| 89 | |
| 90 | // ReadCRLFile reads a file from the provided path, and returns constructed CRL |
| 91 | // struct from it. |
no test coverage detected