MCPcopy
hub / github.com/getsops/sops / MasterKeysFromArnString

Function MasterKeysFromArnString

kms/keysource.go:129–138  ·  view source on GitHub ↗

MasterKeysFromArnString takes a comma separated list of AWS KMS ARNs, and returns a slice of new MasterKeys for those ARNs.

(arn string, context map[string]*string, awsProfile string)

Source from the content-addressed store, hash-verified

127// MasterKeysFromArnString takes a comma separated list of AWS KMS ARNs, and
128// returns a slice of new MasterKeys for those ARNs.
129func MasterKeysFromArnString(arn string, context map[string]*string, awsProfile string) []*MasterKey {
130 var keys []*MasterKey
131 if arn == "" {
132 return keys
133 }
134 for _, s := range strings.Split(arn, ",") {
135 keys = append(keys, NewMasterKeyFromArn(s, context, awsProfile))
136 }
137 return keys
138}
139
140// ParseKMSContext takes either a KMS context map or a comma-separated list of
141// KMS context key:value pairs, and returns a map.

Callers 4

getMasterKeysFunction · 0.92
keyGroupsFunction · 0.92

Calls 1

NewMasterKeyFromArnFunction · 0.85

Tested by 1