From ae0eeea2fb14acf7f556eb697a6523c8f6a399be Mon Sep 17 00:00:00 2001 From: sal rashid Date: Thu, 29 Aug 2024 17:03:26 -0400 Subject: [PATCH] fix signer structures; cleanup Signed-off-by: sal rashid --- README.md | 1 + proto/tinktpm.pb.go | 300 ++++++++++-------- proto/tinktpm.proto | 13 +- proto/tinktpm.proto.pb | Bin 5564 -> 5808 bytes .../tpm_rsassapkcs1_signer_key_manager.go | 50 +-- signature/verifier_factory.go | 21 +- 6 files changed, 205 insertions(+), 180 deletions(-) diff --git a/README.md b/README.md index 6813560..1758ff6 100644 --- a/README.md +++ b/README.md @@ -541,6 +541,7 @@ go test -v ./aead -run ^TestAeadPCRFail$ go test -v ./aead -run ^TestAeadOwnerPassword$ go test -v ./aead -run ^TestAeadOwnerPasswordFail$ +### rsa tests go test -v ./signature -run ^TestSignVerify$ go test -v ./signature -run ^TestSignVerifyFail$ diff --git a/proto/tinktpm.pb.go b/proto/tinktpm.pb.go index a9ca9ff..767be4c 100644 --- a/proto/tinktpm.pb.go +++ b/proto/tinktpm.pb.go @@ -81,8 +81,9 @@ func (HashType) EnumDescriptor() ([]byte, []int) { type TPMKey_KeyType int32 const ( - TPMKey_SYMMETRIC TPMKey_KeyType = 0 - TPMKey_HMAC TPMKey_KeyType = 1 + TPMKey_SYMMETRIC TPMKey_KeyType = 0 + TPMKey_HMAC TPMKey_KeyType = 1 + TPMKey_ASYMMETRIC TPMKey_KeyType = 2 ) // Enum value maps for TPMKey_KeyType. @@ -90,10 +91,12 @@ var ( TPMKey_KeyType_name = map[int32]string{ 0: "SYMMETRIC", 1: "HMAC", + 2: "ASYMMETRIC", } TPMKey_KeyType_value = map[string]int32{ - "SYMMETRIC": 0, - "HMAC": 1, + "SYMMETRIC": 0, + "HMAC": 1, + "ASYMMETRIC": 2, } ) @@ -135,6 +138,8 @@ type TPMKey struct { // // *TPMKey_HmacTpmKey // *TPMKey_AesCtrHmacAEADTpmKey + // *TPMKey_RsassaPublicKey + // *TPMKey_RsassaPrivateKey Key isTPMKey_Key `protobuf_oneof:"Key"` } @@ -205,6 +210,20 @@ func (x *TPMKey) GetAesCtrHmacAEADTpmKey() *AesCtrHmacAeadTpmKey { return nil } +func (x *TPMKey) GetRsassaPublicKey() *RsaSsaPkcs1PublicTpmKey { + if x, ok := x.GetKey().(*TPMKey_RsassaPublicKey); ok { + return x.RsassaPublicKey + } + return nil +} + +func (x *TPMKey) GetRsassaPrivateKey() *RsaSsaPkcs1PrivateTpmKey { + if x, ok := x.GetKey().(*TPMKey_RsassaPrivateKey); ok { + return x.RsassaPrivateKey + } + return nil +} + type isTPMKey_Key interface { isTPMKey_Key() } @@ -217,10 +236,22 @@ type TPMKey_AesCtrHmacAEADTpmKey struct { AesCtrHmacAEADTpmKey *AesCtrHmacAeadTpmKey `protobuf:"bytes,4,opt,name=aesCtrHmacAEADTpmKey,proto3,oneof"` } +type TPMKey_RsassaPublicKey struct { + RsassaPublicKey *RsaSsaPkcs1PublicTpmKey `protobuf:"bytes,5,opt,name=rsassaPublicKey,proto3,oneof"` +} + +type TPMKey_RsassaPrivateKey struct { + RsassaPrivateKey *RsaSsaPkcs1PrivateTpmKey `protobuf:"bytes,6,opt,name=rsassaPrivateKey,proto3,oneof"` +} + func (*TPMKey_HmacTpmKey) isTPMKey_Key() {} func (*TPMKey_AesCtrHmacAEADTpmKey) isTPMKey_Key() {} +func (*TPMKey_RsassaPublicKey) isTPMKey_Key() {} + +func (*TPMKey_RsassaPrivateKey) isTPMKey_Key() {} + // key_type: "type.googleapis.com/github.salrashid123.tink-go-tpm.HmacTpmKey" type HMACTpmKey struct { state protoimpl.MessageState @@ -930,7 +961,7 @@ var File_proto_tinktpm_proto protoreflect.FileDescriptor var file_proto_tinktpm_proto_rawDesc = []byte{ 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x69, 0x6e, 0x6b, 0x74, 0x70, 0x6d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x02, 0x0a, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb1, 0x03, 0x0a, 0x06, 0x54, 0x50, 0x4d, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, @@ -944,114 +975,125 @@ var file_proto_tinktpm_proto_rawDesc = []byte{ 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x48, 0x6d, 0x61, 0x63, 0x41, 0x65, 0x61, 0x64, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x14, 0x61, 0x65, 0x73, 0x43, 0x74, 0x72, 0x48, 0x6d, 0x61, 0x63, - 0x41, 0x45, 0x41, 0x44, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x22, 0x22, 0x0a, 0x07, 0x4b, 0x65, - 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, - 0x49, 0x43, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4d, 0x41, 0x43, 0x10, 0x01, 0x42, 0x05, - 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x22, 0xb1, 0x01, 0x0a, 0x0a, 0x48, 0x4d, 0x41, 0x43, 0x54, 0x70, + 0x41, 0x45, 0x41, 0x44, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x0f, 0x72, 0x73, + 0x61, 0x73, 0x73, 0x61, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x73, 0x61, 0x53, + 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x54, 0x70, 0x6d, + 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0f, 0x72, 0x73, 0x61, 0x73, 0x73, 0x61, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x4d, 0x0a, 0x10, 0x72, 0x73, 0x61, 0x73, 0x73, 0x61, + 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, + 0x6b, 0x63, 0x73, 0x31, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x54, 0x70, 0x6d, 0x4b, 0x65, + 0x79, 0x48, 0x00, 0x52, 0x10, 0x72, 0x73, 0x61, 0x73, 0x73, 0x61, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x32, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x00, 0x12, + 0x08, 0x0a, 0x04, 0x48, 0x4d, 0x41, 0x43, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x53, 0x59, + 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x02, 0x42, 0x05, 0x0a, 0x03, 0x4b, 0x65, 0x79, + 0x22, 0xb1, 0x01, 0x0a, 0x0a, 0x48, 0x4d, 0x41, 0x43, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x6b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x6b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0a, + 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x4d, 0x41, 0x43, 0x54, 0x70, 0x6d, + 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x46, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x22, 0x4c, 0x0a, 0x0a, 0x48, 0x4d, 0x41, 0x43, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x67, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x74, 0x61, 0x67, 0x53, 0x69, + 0x7a, 0x65, 0x22, 0x58, 0x0a, 0x10, 0x48, 0x4d, 0x41, 0x43, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, + 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, + 0x4d, 0x41, 0x43, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x48, 0x0a, 0x12, + 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x76, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x06, 0x69, 0x76, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, + 0x65, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6b, + 0x65, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x0c, 0x41, 0x65, 0x73, 0x43, 0x74, + 0x72, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x65, + 0x73, 0x43, 0x74, 0x72, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x52, 0x09, 0x6b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6b, + 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6b, 0x65, + 0x79, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, + 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x1a, 0x41, + 0x65, 0x73, 0x43, 0x74, 0x72, 0x48, 0x6d, 0x61, 0x63, 0x41, 0x65, 0x61, 0x64, 0x54, 0x70, 0x6d, + 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x65, 0x73, + 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x54, 0x70, 0x6d, 0x4b, + 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x09, 0x61, 0x65, 0x73, 0x46, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x68, 0x6d, 0x61, 0x63, 0x5f, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x48, 0x4d, 0x41, 0x43, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x52, 0x0a, 0x68, 0x6d, 0x61, 0x63, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0xf5, 0x01, + 0x0a, 0x14, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x48, 0x6d, 0x61, 0x63, 0x41, 0x65, 0x61, 0x64, + 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x48, 0x6d, 0x61, 0x63, 0x41, 0x65, 0x61, 0x64, 0x54, + 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x09, 0x6b, 0x65, 0x79, + 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x39, 0x0a, 0x0e, 0x61, 0x65, 0x73, 0x5f, 0x63, 0x74, + 0x72, 0x5f, 0x74, 0x70, 0x6d, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x54, 0x70, 0x6d, + 0x4b, 0x65, 0x79, 0x52, 0x0c, 0x61, 0x65, 0x73, 0x43, 0x74, 0x72, 0x54, 0x70, 0x6d, 0x6b, 0x65, + 0x79, 0x12, 0x32, 0x0a, 0x0b, 0x68, 0x6d, 0x61, 0x63, 0x5f, 0x74, 0x70, 0x6d, 0x6b, 0x65, 0x79, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, + 0x4d, 0x41, 0x43, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x68, 0x6d, 0x61, 0x63, 0x54, + 0x70, 0x6d, 0x6b, 0x65, 0x79, 0x22, 0x41, 0x0a, 0x11, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, + 0x6b, 0x63, 0x73, 0x31, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2c, 0x0a, 0x09, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, + 0x68, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x17, 0x52, 0x73, 0x61, + 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, + 0x73, 0x31, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x6e, 0x12, 0x0c, + 0x0a, 0x01, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x65, 0x22, 0xb2, 0x01, 0x0a, + 0x18, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x50, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x12, 0x36, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x4d, - 0x41, 0x43, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x09, - 0x6b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x4c, 0x0a, 0x0a, 0x48, 0x4d, 0x41, - 0x43, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x61, - 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, - 0x74, 0x61, 0x67, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, - 0x74, 0x61, 0x67, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x58, 0x0a, 0x10, 0x48, 0x4d, 0x41, 0x43, 0x54, - 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x4d, 0x41, 0x43, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x53, 0x69, 0x7a, - 0x65, 0x22, 0x48, 0x0a, 0x12, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x54, 0x70, 0x6d, 0x4b, 0x65, - 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x76, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x69, 0x76, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x0c, - 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, - 0x90, 0x01, 0x0a, 0x1a, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x48, 0x6d, 0x61, 0x63, 0x41, 0x65, - 0x61, 0x64, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x38, - 0x0a, 0x0a, 0x61, 0x65, 0x73, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x65, 0x73, 0x43, 0x74, - 0x72, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x09, 0x61, - 0x65, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x68, 0x6d, 0x61, 0x63, - 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x4d, 0x41, 0x43, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, - 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x0a, 0x68, 0x6d, 0x61, 0x63, 0x46, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x22, 0xf5, 0x01, 0x0a, 0x14, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x48, 0x6d, 0x61, - 0x63, 0x41, 0x65, 0x61, 0x64, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x6b, 0x65, 0x79, - 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x65, 0x73, 0x43, 0x74, 0x72, 0x48, 0x6d, 0x61, 0x63, - 0x41, 0x65, 0x61, 0x64, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x52, 0x09, 0x6b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x39, 0x0a, 0x0e, 0x61, - 0x65, 0x73, 0x5f, 0x63, 0x74, 0x72, 0x5f, 0x74, 0x70, 0x6d, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x65, 0x73, 0x43, - 0x74, 0x72, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x52, 0x0c, 0x61, 0x65, 0x73, 0x43, 0x74, 0x72, - 0x54, 0x70, 0x6d, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x0b, 0x68, 0x6d, 0x61, 0x63, 0x5f, 0x74, - 0x70, 0x6d, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x4d, 0x41, 0x43, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x52, 0x0a, - 0x68, 0x6d, 0x61, 0x63, 0x54, 0x70, 0x6d, 0x6b, 0x65, 0x79, 0x22, 0x41, 0x0a, 0x11, 0x52, 0x73, - 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x2c, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x08, 0x68, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x81, 0x01, - 0x0a, 0x17, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x73, 0x61, 0x53, - 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x01, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, - 0x65, 0x22, 0xb2, 0x01, 0x0a, 0x18, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, - 0x31, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x54, 0x70, 0x6d, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x66, 0x69, - 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x66, 0x69, 0x6c, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x64, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0xa5, 0x01, 0x0a, 0x17, 0x52, 0x73, 0x61, 0x53, 0x73, - 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x4b, 0x65, 0x79, 0x54, 0x70, 0x6d, 0x46, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x73, 0x61, 0x53, 0x73, - 0x61, 0x50, 0x6b, 0x63, 0x73, 0x31, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2f, 0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x75, 0x73, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x11, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x75, 0x73, 0x53, 0x69, 0x7a, 0x65, 0x49, - 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x45, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2a, 0x56, - 0x0a, 0x08, 0x48, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, - 0x53, 0x48, 0x41, 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, - 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x0a, - 0x0a, 0x06, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, - 0x41, 0x32, 0x32, 0x34, 0x10, 0x05, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x61, 0x6c, 0x72, 0x61, 0x73, 0x68, 0x69, 0x64, 0x31, 0x32, - 0x33, 0x2f, 0x74, 0x69, 0x6e, 0x6b, 0x2d, 0x67, 0x6f, 0x2d, 0x74, 0x70, 0x6d, 0x2f, 0x76, 0x32, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x22, 0xa5, 0x01, 0x0a, 0x17, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, + 0x31, 0x4b, 0x65, 0x79, 0x54, 0x70, 0x6d, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x30, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x73, 0x61, 0x53, 0x73, 0x61, 0x50, 0x6b, 0x63, 0x73, + 0x31, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x2f, 0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x75, 0x73, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, + 0x69, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x75, 0x73, 0x53, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x42, 0x69, 0x74, 0x73, + 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x45, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2a, 0x56, 0x0a, 0x08, 0x48, 0x61, 0x73, + 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x48, 0x41, 0x31, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x0a, 0x0a, + 0x06, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, + 0x35, 0x31, 0x32, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x32, 0x32, 0x34, 0x10, + 0x05, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x73, 0x61, 0x6c, 0x72, 0x61, 0x73, 0x68, 0x69, 0x64, 0x31, 0x32, 0x33, 0x2f, 0x74, 0x69, 0x6e, + 0x6b, 0x2d, 0x67, 0x6f, 0x2d, 0x74, 0x70, 0x6d, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1088,24 +1130,26 @@ var file_proto_tinktpm_proto_depIdxs = []int32{ 1, // 0: proto.TPMKey.keyType:type_name -> proto.TPMKey.KeyType 3, // 1: proto.TPMKey.hmacTpmKey:type_name -> proto.HMACTpmKey 9, // 2: proto.TPMKey.aesCtrHmacAEADTpmKey:type_name -> proto.AesCtrHmacAeadTpmKey - 5, // 3: proto.HMACTpmKey.key_format:type_name -> proto.HMACTpmKeyFormat - 0, // 4: proto.HMACParams.hash:type_name -> proto.HashType - 4, // 5: proto.HMACTpmKeyFormat.params:type_name -> proto.HMACParams - 6, // 6: proto.AesCtrTpmKey.key_format:type_name -> proto.AesCtrTpmKeyFormat - 6, // 7: proto.AesCtrHmacAeadTpmKeyFormat.aes_format:type_name -> proto.AesCtrTpmKeyFormat - 5, // 8: proto.AesCtrHmacAeadTpmKeyFormat.hmac_format:type_name -> proto.HMACTpmKeyFormat - 8, // 9: proto.AesCtrHmacAeadTpmKey.key_format:type_name -> proto.AesCtrHmacAeadTpmKeyFormat - 7, // 10: proto.AesCtrHmacAeadTpmKey.aes_ctr_tpmkey:type_name -> proto.AesCtrTpmKey - 3, // 11: proto.AesCtrHmacAeadTpmKey.hmac_tpmkey:type_name -> proto.HMACTpmKey - 0, // 12: proto.RsaSsaPkcs1Params.hash_type:type_name -> proto.HashType - 10, // 13: proto.RsaSsaPkcs1PublicTpmKey.params:type_name -> proto.RsaSsaPkcs1Params - 11, // 14: proto.RsaSsaPkcs1PrivateTpmKey.public_key:type_name -> proto.RsaSsaPkcs1PublicTpmKey - 10, // 15: proto.RsaSsaPkcs1KeyTpmFormat.params:type_name -> proto.RsaSsaPkcs1Params - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 11, // 3: proto.TPMKey.rsassaPublicKey:type_name -> proto.RsaSsaPkcs1PublicTpmKey + 12, // 4: proto.TPMKey.rsassaPrivateKey:type_name -> proto.RsaSsaPkcs1PrivateTpmKey + 5, // 5: proto.HMACTpmKey.key_format:type_name -> proto.HMACTpmKeyFormat + 0, // 6: proto.HMACParams.hash:type_name -> proto.HashType + 4, // 7: proto.HMACTpmKeyFormat.params:type_name -> proto.HMACParams + 6, // 8: proto.AesCtrTpmKey.key_format:type_name -> proto.AesCtrTpmKeyFormat + 6, // 9: proto.AesCtrHmacAeadTpmKeyFormat.aes_format:type_name -> proto.AesCtrTpmKeyFormat + 5, // 10: proto.AesCtrHmacAeadTpmKeyFormat.hmac_format:type_name -> proto.HMACTpmKeyFormat + 8, // 11: proto.AesCtrHmacAeadTpmKey.key_format:type_name -> proto.AesCtrHmacAeadTpmKeyFormat + 7, // 12: proto.AesCtrHmacAeadTpmKey.aes_ctr_tpmkey:type_name -> proto.AesCtrTpmKey + 3, // 13: proto.AesCtrHmacAeadTpmKey.hmac_tpmkey:type_name -> proto.HMACTpmKey + 0, // 14: proto.RsaSsaPkcs1Params.hash_type:type_name -> proto.HashType + 10, // 15: proto.RsaSsaPkcs1PublicTpmKey.params:type_name -> proto.RsaSsaPkcs1Params + 11, // 16: proto.RsaSsaPkcs1PrivateTpmKey.public_key:type_name -> proto.RsaSsaPkcs1PublicTpmKey + 10, // 17: proto.RsaSsaPkcs1KeyTpmFormat.params:type_name -> proto.RsaSsaPkcs1Params + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_proto_tinktpm_proto_init() } @@ -1262,6 +1306,8 @@ func file_proto_tinktpm_proto_init() { file_proto_tinktpm_proto_msgTypes[0].OneofWrappers = []interface{}{ (*TPMKey_HmacTpmKey)(nil), (*TPMKey_AesCtrHmacAEADTpmKey)(nil), + (*TPMKey_RsassaPublicKey)(nil), + (*TPMKey_RsassaPrivateKey)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/proto/tinktpm.proto b/proto/tinktpm.proto index a0a10c8..47edb13 100644 --- a/proto/tinktpm.proto +++ b/proto/tinktpm.proto @@ -14,10 +14,13 @@ message TPMKey { enum KeyType { SYMMETRIC = 0; HMAC = 1; + ASYMMETRIC = 2; } oneof Key { HMACTpmKey hmacTpmKey = 3; AesCtrHmacAeadTpmKey aesCtrHmacAEADTpmKey = 4; + RsaSsaPkcs1PublicTpmKey rsassaPublicKey = 5; + RsaSsaPkcs1PrivateTpmKey rsassaPrivateKey = 6; } } @@ -77,9 +80,6 @@ message AesCtrHmacAeadTpmKey { } - - - message RsaSsaPkcs1Params { HashType hash_type = 1; } @@ -96,13 +96,6 @@ message RsaSsaPkcs1PublicTpmKey { message RsaSsaPkcs1PrivateTpmKey { uint32 version = 1; RsaSsaPkcs1PublicTpmKey public_key = 2; - //bytes d = 3; - //bytes p = 4; - //bytes q = 5; - //bytes dp = 6; - //bytes dq = 7; - //bytes crt = 8; - bytes keyfile = 3; bytes policy_digest = 4; } diff --git a/proto/tinktpm.proto.pb b/proto/tinktpm.proto.pb index 0a7e39043dfc3152e5f171ceed280c2d8daa336a..7142201c16bae3aca7f6e4d4f5c5e456437b41ce 100644 GIT binary patch delta 2472 zcmZXW%W@l45Qb;YoEeSI$hJHq$(QJ2DZXIKvW(?aY$}eOvPI#GOe$m%R$z(5R!lBs z8>(2%ngxrL9)K+yC@3#r!AtN0?0E|K`<$Mk3RcNi-G9%2y89gY_vX*7CG}%VMQ^X( z+`MVu3}0W~ynVH%DRlKejb9w)J$>98{pnWUb$=^{M{45g`t17p?D1FqFNcHU=if}b zqrjVQe`G!RZzSxgJSSfbzdpNpPTAg^{a&z98%=uA=%*-Gg6@Awjg5DIH}c`QQjb3Q zwAbrCeR8;;7q@l$TQB=ZS$Uzfte2zP%sqSh_OHyDZBLGlv#;YZmk7C`AE{X^x>6PCJHL1*4sirS4(vQx|%=1IssiRj93Sl6SEw0 zAe&2N4rFtFasr1kr)OA(_SQv%Wz^ofpe1l)d>rj?>QN;LLRX)wD}_FZP|jORHvaEO zGBwZ564a~(*eCY@)LRfLAtWvY#yw&vx4`ZN)mRiIPNZgCE^?C*qhQu_5(M31p-47d ztm(3~u5Gxqq|5FY9m}=I#)^oj9sxotLN6&1I=q5Szto8cHAmm&Ud2t}ak`C!W>#?} zz^WMI5cym+#!!i_!fKG?MEGi@iPZ8|n&=?0l_sL)YiT0&cnyg(ZIEh5@{MvC^xKoW*YS24S!ls*P%9agt=t^Ors;r)`5`N8PhG2pcwW$r76}S zw#nmg1dU_Ud>ENDjZK~g2(nEx4Jku;-}=DVpkv+lXLUJAHn#W%0Z?v>%Yl%%g&U;z z9f*2ce1-I8ZLe&O|+(?&f?63_0%I$DDP>jqS zzR5t;+hH3n4gH~**UJe&7a#J5gD6(4B{9ezHty0fxXH8wc>edT56!7PWbOM6ZNsBeAFz7>+#j$h5E2iJ z`x6O7y#u!Ik;SgKt4{`iu4`TfB+{w7k@*b(LDsD|)BrXzp**xc9_{4^@u6SV4l?B6 zi2Dw}fsVNEAXGZywu4aVh})ha1IPS;0w6o)K7c634=4z-V}3w0)b&@eNX=h*7*mD2)io) delta 2311 zcmX|@&rTax6vk)H+_A@Zpx`kkU~B_J6#f_jB$zZ9sz8g`VL+91-fm&bMKj1B|n|>o%!y$=UnsK%Ac)y{YOhz`fslX z*Qg`X#E7u)O|1I^BA+3}XIFTyTn5T!d&*Vm4IS6&gF`~$eRMUot3QQklgv4lMG9wRE zZ-@*~Q4b{KK~_-{89`Q=Tw$u>10JWYt?Ls_%8k^dGoAh%o+Oh&WJnSks&liWeK^EO;Ir;js-&*K{hoqDl(k6PGcIK@s&#iT|L(kboF3F zbOc>Js)!EIpqhj{$QrrKgRBu`C*booCMHFuBCkoY$Q1h2q=+fO$I%Y2S!rZJ=$bRL zTBA=CsafZ)i~oCyP0dQPh?^C|KD!5?UQ9Y8B*vk2j~L3u;-0w19F0pNH!GQwCL_kd zlIAT&>AYM9XB`EsN$O(H@I6vn4B zZw7<@yRFsLue*ac-<;h~{~7)~S)hWHa3NYKX{ioaq+toM_eE zuVE=q^pLoeC*m4fc_R0{g+!hKltj0^R-TF8Ea#a%GMDp`J`$Ia$Tx&FS#=)R8{!YI z1{3DSJ#Nh!*IS>-t*ebIFK-6o?TA69v6dM5OHgg@@*c2Ox zLAEJ2{75}^KC(8rXO9EBr9Ru(5*q-N+mdpi1esg1-9Xga5*t2WdWY_sfd!z89hrI% z$Ewp=46;riM3+l!}ksa(y-vKz#zVsc0O8e4w5Gw6U+ly@A zKps^9WCzj*5Xa&O;MdDwP zBm0af5M)Oq_HhJpCLTxr%_6e!M@l>47z@B$IJo