(length int)
| 242 | } |
| 243 | |
| 244 | func generateKey(length int) (string, error) { |
| 245 | b := make([]byte, length) |
| 246 | _, err := rand.Read(b) |
| 247 | if err != nil { |
| 248 | return "", xerrors.Errorf("rand read: %w", err) |
| 249 | } |
| 250 | return hex.EncodeToString(b), nil |
| 251 | } |
| 252 | |
| 253 | func tokenDuration(feature database.CryptoKeyFeature) time.Duration { |
| 254 | switch feature { |
no test coverage detected