-
Notifications
You must be signed in to change notification settings - Fork 45
/
const.go
81 lines (69 loc) · 1.76 KB
/
const.go
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package wrapping
type WrapperType string
// These values define known types of Wrappers
const (
WrapperTypeUnknown WrapperType = "unknown"
WrapperTypeAead WrapperType = "aead"
WrapperTypeAliCloudKms WrapperType = "alicloudkms"
WrapperTypeAwsKms WrapperType = "awskms"
WrapperTypeAzureKeyVault WrapperType = "azurekeyvault"
WrapperTypeGcpCkms WrapperType = "gcpckms"
WrapperTypeHsmAuto WrapperType = "hsm-auto"
WrapperTypeHuaweiCloudKms WrapperType = "huaweicloudkms"
WrapperTypeOciKms WrapperType = "ocikms"
WrapperTypePkcs11 WrapperType = "pkcs11"
WrapperTypePooled WrapperType = "pooled"
WrapperTypeShamir WrapperType = "shamir"
WrapperTypeTencentCloudKms WrapperType = "tencentcloudkms"
WrapperTypeTransit WrapperType = "transit"
WrapperTypeTest WrapperType = "test-auto"
)
func (t WrapperType) String() string {
return string(t)
}
type AeadType uint32
// These values define supported types of AEADs
const (
AeadTypeUnknown AeadType = iota
AeadTypeAesGcm
)
func (t AeadType) String() string {
switch t {
case AeadTypeAesGcm:
return "aes-gcm"
default:
return "unknown"
}
}
func AeadTypeMap(t string) AeadType {
switch t {
case "aes-gcm":
return AeadTypeAesGcm
default:
return AeadTypeUnknown
}
}
type HashType uint32
// These values define supported types of hashes
const (
HashTypeUnknown HashType = iota
HashTypeSha256
)
func (t HashType) String() string {
switch t {
case HashTypeSha256:
return "sha256"
default:
return "unknown"
}
}
func HashTypeMap(t string) HashType {
switch t {
case "sha256":
return HashTypeSha256
default:
return HashTypeUnknown
}
}