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

Function NewMasterKey

hckms/keysource.go:64–75  ·  view source on GitHub ↗

NewMasterKey creates a new MasterKey from a region:key-id string, setting the creation date to the current date.

(keyID string)

Source from the content-addressed store, hash-verified

62// NewMasterKey creates a new MasterKey from a region:key-id string, setting
63// the creation date to the current date.
64func NewMasterKey(keyID string) (*MasterKey, error) {
65 region, keyUUID, err := parseKeyID(keyID)
66 if err != nil {
67 return nil, err
68 }
69 return &MasterKey{
70 KeyID: keyID,
71 Region: region,
72 KeyUUID: keyUUID,
73 CreationDate: time.Now().UTC(),
74 }, nil
75}
76
77// NewMasterKeyFromKeyIDString takes a comma separated list of HuaweiCloud KMS
78// key IDs in format "region:key-uuid", and returns a slice of new MasterKeys.

Callers 14

toInternalMethod · 0.92
encryptWithHckmsMethod · 0.92
decryptWithHckmsMethod · 0.92
extractMasterKeysFunction · 0.92
TestNewMasterKeyFunction · 0.70
TestMasterKey_ToStringFunction · 0.70
TestMasterKey_ToMapFunction · 0.70

Calls 1

parseKeyIDFunction · 0.85