Key implements crypto.KeyVault.
(ctx context.Context, label string)
| 138 | |
| 139 | // Key implements crypto.KeyVault. |
| 140 | func (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 | |
| 148 | func (c *cacheKeyVault) cacheCertificateTTL(crt tls.Certificate) (time.Duration, bool) { |
| 149 | if len(crt.Certificate) > 0 { |