MCPcopy
hub / github.com/grpc/grpc-go / NewStaticCRLProvider

Function NewStaticCRLProvider

security/advancedtls/crl_provider.go:65–77  ·  view source on GitHub ↗

NewStaticCRLProvider processes raw content of CRL files, adds parsed CRL structs into in-memory, and returns a new instance of the StaticCRLProvider.

(rawCRLs [][]byte)

Source from the content-addressed store, hash-verified

63// NewStaticCRLProvider processes raw content of CRL files, adds parsed CRL
64// structs into in-memory, and returns a new instance of the StaticCRLProvider.
65func NewStaticCRLProvider(rawCRLs [][]byte) *StaticCRLProvider {
66 p := StaticCRLProvider{}
67 p.crls = make(map[string]*CRL)
68 for idx, rawCRL := range rawCRLs {
69 cRL, err := NewCRL(rawCRL)
70 if err != nil {
71 grpclogLogger.Warningf("Can't parse raw CRL number %v from the slice: %v", idx, err)
72 continue
73 }
74 p.addCRL(cRL)
75 }
76 return &p
77}
78
79// AddCRL adds/updates provided CRL to in-memory storage.
80func (p *StaticCRLProvider) addCRL(crl *CRL) {

Callers 3

TestRevokedCertFunction · 0.85
TestStaticCRLProviderMethod · 0.85

Calls 3

addCRLMethod · 0.95
NewCRLFunction · 0.85
WarningfMethod · 0.65

Tested by 3

TestRevokedCertFunction · 0.68
TestStaticCRLProviderMethod · 0.68