MCPcopy
hub / github.com/caddyserver/caddy / storeSTEK

Method storeSTEK

modules/caddytls/distributedstek/distributedstek.go:133–144  ·  view source on GitHub ↗
(dstek distributedSTEK)

Source from the content-addressed store, hash-verified

131}
132
133func (s *Provider) storeSTEK(dstek distributedSTEK) error {
134 var buf bytes.Buffer
135 err := gob.NewEncoder(&buf).Encode(dstek)
136 if err != nil {
137 return fmt.Errorf("encoding STEK gob: %v", err)
138 }
139 err = s.storage.Store(s.ctx, stekFileName, buf.Bytes())
140 if err != nil {
141 return fmt.Errorf("storing STEK gob: %v", err)
142 }
143 return nil
144}
145
146// getSTEK locks and loads the current STEK from storage. If none
147// currently exists, a new STEK is created and persisted. If the

Callers 1

rotateKeysMethod · 0.95

Calls 1

NewEncoderMethod · 0.65

Tested by

no test coverage detected