MCPcopy Index your code
hub / github.com/coder/coder / checkKey

Function checkKey

coderd/cryptokeys/cache.go:287–300  ·  view source on GitHub ↗
(key codersdk.CryptoKey, sequence int32, now time.Time)

Source from the content-addressed store, hash-verified

285}
286
287func checkKey(key codersdk.CryptoKey, sequence int32, now time.Time) (string, []byte, error) {
288 if sequence == latestSequence {
289 if !key.CanSign(now) {
290 return "", nil, ErrKeyInvalid
291 }
292 return idSecret(key)
293 }
294
295 if !key.CanVerify(now) {
296 return "", nil, ErrKeyInvalid
297 }
298
299 return idSecret(key)
300}
301
302// refresh fetches the keys and updates the cache.
303func (c *cache) refresh() {

Callers 1

cryptoKeyMethod · 0.85

Calls 3

idSecretFunction · 0.85
CanSignMethod · 0.45
CanVerifyMethod · 0.45

Tested by

no test coverage detected