Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions kms/protobuf/request.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions kms/protobuf/request.proto
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ message ImportKeyRingVersion {
// Version is the version number of the key version. It must be non-zero
// and unique within the key ring; the KMS server verifies this.
uint32 Version = 3 [ json_name = "version" ];

// MACKey is the optional secret key used for computing message
// authentication codes (MACs) with this key version.
bytes MACKey = 4 [ json_name = "mac_key" ];
}

message ImportKeyRingRequest {
Expand Down
9 changes: 7 additions & 2 deletions kms/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ type ImportKeyVersion struct {
// Key is the secret key imported into the KMS server.
// It must be a valid key for the given key type.
Key []byte

// MACKey is the optional secret key imported into the KMS server for
// computing message authentication codes (MACs) with this key version.
// If empty, the server generates one.
MACKey []byte
}

// ImportKeyRingRequest contains options for importing a full key ring,
Expand All @@ -562,7 +567,7 @@ func (r *ImportKeyRingRequest) MarshalPB(v *pb.ImportKeyRingRequest) error {
v.Name = r.Name
v.Versions = make([]*pb.ImportKeyRingVersion, 0, len(r.Versions))
for _, version := range r.Versions {
pv := &pb.ImportKeyRingVersion{Key: version.Key, Version: version.Version}
pv := &pb.ImportKeyRingVersion{Key: version.Key, Version: version.Version, MACKey: version.MACKey}
if version.Type != 0 {
pv.Type = version.Type.String()
}
Expand All @@ -583,7 +588,7 @@ func (r *ImportKeyRingRequest) UnmarshalPB(v *pb.ImportKeyRingRequest) error {
return err
}
}
versions = append(versions, ImportKeyVersion{Type: t, Key: pv.GetKey(), Version: pv.GetVersion()})
versions = append(versions, ImportKeyVersion{Type: t, Key: pv.GetKey(), Version: pv.GetVersion(), MACKey: pv.GetMACKey()})
}

r.Name = v.Name
Expand Down
Loading