-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkey.go
More file actions
29 lines (22 loc) · 693 Bytes
/
key.go
File metadata and controls
29 lines (22 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package tinykms
import "time"
// KeyPriority is an indicator how a key should be handled by the KMS.
// 0 = no priority
// 1 = highest priority
// 255 = lowest priority
type KeyPriority uint8
// Key is the representation for a single key with its metadata.
type Key struct {
// ID is unique identifier for the given (raw) key.
ID string `json:"id"`
// Raw is the key itself.
Raw string `json:"raw"`
// Priority allows easier and more graceful key rotation.
Priority KeyPriority `json:"priority"`
// CreatedAt represents the date the key was generated.
CreatedAt time.Time `json:"created_at"`
}
// Implement the Stringer interface.
func (k Key) String() string {
return k.Raw
}