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

Function NewFileWatcherCRLProvider

security/advancedtls/crl_provider.go:115–128  ·  view source on GitHub ↗

NewFileWatcherCRLProvider returns a new instance of the FileWatcherCRLProvider. It uses FileWatcherOptions to validate and apply configuration required for creating a new instance. The initial scan of CRLDirectory is performed inside this function. Users should call Close to stop the background refr

(o FileWatcherOptions)

Source from the content-addressed store, hash-verified

113// CRLDirectory is performed inside this function. Users should call Close to
114// stop the background refresh of CRLDirectory.
115func NewFileWatcherCRLProvider(o FileWatcherOptions) (*FileWatcherCRLProvider, error) {
116 if err := o.validate(); err != nil {
117 return nil, err
118 }
119 provider := &FileWatcherCRLProvider{
120 crls: make(map[string]*CRL),
121 opts: o,
122 stop: make(chan struct{}),
123 done: make(chan struct{}),
124 }
125 provider.scanCRLDirectory()
126 go provider.run()
127 return provider, nil
128}
129
130func (o *FileWatcherOptions) validate() error {
131 // Checks relates to CRLDirectory.

Callers 7

makeCRLProviderFunction · 0.92
makeCRLProviderFunction · 0.92
TestRevokedCertFunction · 0.85
TestVerifyConnectionFunction · 0.85

Calls 3

scanCRLDirectoryMethod · 0.95
runMethod · 0.95
validateMethod · 0.45