MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Key

Method Key

pkg/crypto/cryptoutil/keyvault_cache.go:140–146  ·  view source on GitHub ↗

Key implements crypto.KeyVault.

(ctx context.Context, label string)

Source from the content-addressed store, hash-verified

138
139// Key implements crypto.KeyVault.
140func (c *cacheKeyVault) Key(ctx context.Context, label string) ([]byte, error) {
141 val, err := c.getOrLoad(ctx, crypto.CacheEncryptionKey, label, func() (any, time.Duration, error) {
142 val, err := c.inner.Key(ctx, label)
143 return val, 0, err
144 })
145 return val.([]byte), err //nolint:revive
146}
147
148func (c *cacheKeyVault) cacheCertificateTTL(crt tls.Certificate) (time.Duration, bool) {
149 if len(crt.Certificate) > 0 {

Callers

nothing calls this directly

Calls 2

getOrLoadMethod · 0.95
KeyMethod · 0.65

Tested by

no test coverage detected