From 50d3649acf2143125b1eb1fece68b43c091596c5 Mon Sep 17 00:00:00 2001 From: alexvanin Date: Thu, 16 Jan 2020 14:17:34 +0300 Subject: [PATCH] object: Add public key header type Object can contain public key header. It will be used for object verification. This header can contain owner's public key or be the part of x509 chain verification in couple with verification header. --- object/types.go | 6 ++++++ object/types.pb.go | Bin 79138 -> 85248 bytes object/types.proto | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/object/types.go b/object/types.go index f433b9c9..79cef655 100644 --- a/object/types.go +++ b/object/types.go @@ -67,6 +67,8 @@ const ( IntegrityHdr // StorageGroupHdr is a storage group header type. StorageGroupHdr + // PublicKeyHdr is a public key header type. + PublicKeyHdr ) var ( @@ -140,6 +142,8 @@ func (m Header) typeOf(t isHeader_Value) (ok bool) { _, ok = m.Value.(*Header_Integrity) case *Header_StorageGroup: _, ok = m.Value.(*Header_StorageGroup) + case *Header_PublicKey: + _, ok = m.Value.(*Header_PublicKey) } return } @@ -168,6 +172,8 @@ func HeaderType(t headerType) Pred { return func(h *Header) bool { _, ok := h.Value.(*Header_Integrity); return ok } case StorageGroupHdr: return func(h *Header) bool { _, ok := h.Value.(*Header_StorageGroup); return ok } + case PublicKeyHdr: + return func(h *Header) bool { _, ok := h.Value.(*Header_PublicKey); return ok } default: return nil } diff --git a/object/types.pb.go b/object/types.pb.go index b5a1e785e86633310ad63204e2a52d2b49da629d..525b39b3b8b633290cdfab4649036dd57a343266 100644 GIT binary patch delta 6481 zcmZXYTZmm(8OJ%HX>w+obV$R*Nz<@1N}LHpW?#-V5ZX#GK`EWIHZP?(`*twn%$!N) z44kpVT`h`=3h5R?D$(@R^)>gDv4`S$4I^e^h=&mX$4*j@5A z2UoY!f%oi0eY|#R{JOkxwLj=5TfH;0$@U=MTnK`N{>EToJzmSt?jBpvsc50Up7(pR z-pXcw{mkrmx4(9IkgshFwr7_ou1!qzwnj7FziZ|6iGyRI<+3+3IyAeqw>Uv)8<9#?JNBn_H_Y|K9w=6_Snnj#s{xPc3~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H}rTe8uP6^m%-2zX{P6SD+UztDTcg?V7 zTVmx{U~nBIoVkprqr9~1uqDYZ(wzF&n)m znjQ`$xlc$j0At3+*qjtp&ObFWv{I_Ekz3n3x<6(7zG%BIJaDa)B=XrHyKSAENgF?a@@9a*h#WMXYS*G z5jWSQ!H_r-J49#rpb43Cuyx{&6NJ}Z>mwLC(ohN3o^7<>)gX0Bb&k?TDc|TMHq1M} zV>znJDBd3Om;q(3R-+2+3XXXWug>$kH=2Am+;9xQ9eEaF~or|xY{|~)NG8F&- diff --git a/object/types.proto b/object/types.proto index 8f50f76e..293f3470 100644 --- a/object/types.proto +++ b/object/types.proto @@ -45,6 +45,8 @@ message Header { IntegrityHeader Integrity = 9; // StorageGroup contains meta information for the data audit storagegroup.StorageGroup StorageGroup = 10; + // PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. + PublicKey PublicKey = 11; } } @@ -122,3 +124,8 @@ message Object { // Payload is an object's payload bytes Payload = 3; } + +message PublicKey { + // Value contains marshaled ecdsa public key + bytes Value = 1; +}