From 3d6d1a533134ab5fe7f0eaa97c5c44e1077270a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Oct 2022 11:09:13 +0800 Subject: [PATCH] node initial function --- did/store/kvstore.go | 2 +- .../main.go => node/checkProof/check.go | 21 +- node/main.go | 68 ++ node/private.pem | 28 + node/public.pem | 9 + node/sendDID/go.mod | 9 + node/sendDID/go.sum | 133 ++++ node/sendDID/peer/main.go | 93 +++ node/sendDID/proto/did.proto | 17 + node/sendDID/proto/pb/proto_demo/did.pb.go | 164 +++++ node/sendDID/proto/pb/proto_demo/peer.pb.go | 240 +++++++ .../sendDID/proto/pb/proto_demo/request.pb.go | 232 +++++++ .../proto/pb/proto_demo/response.pb.go | 252 +++++++ node/sendDID/proto/peer.proto | 17 + node/sendDID/proto/request.proto | 28 + node/sendDID/proto/response.proto | 46 ++ node/vaultRegist/README.md | 155 +++++ node/vaultRegist/main.go | 185 +++++ node/vaultRegist/private.pem | 28 + node/vaultRegist/public.pem | 9 + node/vaultRegist/test/did1-expected.json | 57 ++ node/vaultRegist/test/did1.json | 59 ++ node/vaultRegist/test/util.go | 13 + node/vaultindex/index.go | 8 +- test/ECDSA_test/main.go | 6 + test/Vault_test/main.go | 64 ++ test/XRSA_test/main.go | 145 ++++ test/XRSA_test/private.pem | 28 + test/XRSA_test/public.pem | 9 + test/XRSA_test/test/data.json | 6 + test/XRSA_test/test/did1-expected.json | 57 ++ test/XRSA_test/test/did1.json | 59 ++ test/XRSA_test/test/pri.base64cert | 1 + test/XRSA_test/test/pri.pem | 28 + test/XRSA_test/test/pub.base64cert | 1 + test/XRSA_test/test/pub.pem | 9 + test/XRSA_test/test/util.go | 13 + vendor/xrsa/go.mod | 5 + vendor/xrsa/go.sum | 640 ++++++++++++++++++ vendor/xrsa/rsa.go | 115 ++++ vendor/xrsa/xrsa.go | 226 +++++++ vendor/xrsa/xrsa_test.go | 121 ++++ 42 files changed, 3397 insertions(+), 9 deletions(-) rename test/checkProof_test/main.go => node/checkProof/check.go (71%) create mode 100644 node/main.go create mode 100644 node/private.pem create mode 100644 node/public.pem create mode 100644 node/sendDID/go.mod create mode 100644 node/sendDID/go.sum create mode 100644 node/sendDID/peer/main.go create mode 100644 node/sendDID/proto/did.proto create mode 100644 node/sendDID/proto/pb/proto_demo/did.pb.go create mode 100644 node/sendDID/proto/pb/proto_demo/peer.pb.go create mode 100644 node/sendDID/proto/pb/proto_demo/request.pb.go create mode 100644 node/sendDID/proto/pb/proto_demo/response.pb.go create mode 100644 node/sendDID/proto/peer.proto create mode 100644 node/sendDID/proto/request.proto create mode 100644 node/sendDID/proto/response.proto create mode 100644 node/vaultRegist/README.md create mode 100644 node/vaultRegist/main.go create mode 100644 node/vaultRegist/private.pem create mode 100644 node/vaultRegist/public.pem create mode 100644 node/vaultRegist/test/did1-expected.json create mode 100644 node/vaultRegist/test/did1.json create mode 100644 node/vaultRegist/test/util.go create mode 100644 test/Vault_test/main.go create mode 100644 test/XRSA_test/main.go create mode 100644 test/XRSA_test/private.pem create mode 100644 test/XRSA_test/public.pem create mode 100644 test/XRSA_test/test/data.json create mode 100644 test/XRSA_test/test/did1-expected.json create mode 100644 test/XRSA_test/test/did1.json create mode 100644 test/XRSA_test/test/pri.base64cert create mode 100644 test/XRSA_test/test/pri.pem create mode 100644 test/XRSA_test/test/pub.base64cert create mode 100644 test/XRSA_test/test/pub.pem create mode 100644 test/XRSA_test/test/util.go create mode 100644 vendor/xrsa/go.mod create mode 100644 vendor/xrsa/go.sum create mode 100644 vendor/xrsa/rsa.go create mode 100644 vendor/xrsa/xrsa.go create mode 100644 vendor/xrsa/xrsa_test.go diff --git a/did/store/kvstore.go b/did/store/kvstore.go index 5751be6..ffce1ee 100644 --- a/did/store/kvstore.go +++ b/did/store/kvstore.go @@ -56,7 +56,7 @@ func NewProvider(conf StoreConfig) (*StoreProvider, error) { Config: conf, Store: *store, } - defer db.Close() + //defer db.Close() return sp, nil } diff --git a/test/checkProof_test/main.go b/node/checkProof/check.go similarity index 71% rename from test/checkProof_test/main.go rename to node/checkProof/check.go index 3c32230..ee78141 100644 --- a/test/checkProof_test/main.go +++ b/node/checkProof/check.go @@ -1,4 +1,4 @@ -package main +package checkProof import ( "github.com/ethereum/go-ethereum/common/hexutil" @@ -6,6 +6,15 @@ import ( "github.com/gin-gonic/gin" ) +/* +{ + "Request": "request", + "Vault_ID": "1", + "Entry_ID": "1", + "Signature": "0xe1f40c94e0640573cf7af5ad0522303956ceaf6efa33e76ade206b7bf2f386fd3c68fad8c92b40b92ba10c997e8783230a14c46da14bf0eff81c0e8b595d114d00" +} +*/ + type Proof struct { Request string Vault_ID string @@ -13,21 +22,25 @@ type Proof struct { Signature string } +/* func main() { r := gin.Default() - r.POST("/proof", checkProof) + r.POST("/proof", CheckProof) r.Run(":8080") -} +}*/ -func checkProof(c *gin.Context) { +func CheckProof(c *gin.Context) { json := Proof{} c.BindJSON(&json) str := json.Request + json.Entry_ID + json.Vault_ID hash := crypto.Keccak256Hash([]byte(str)) sig, _ := hexutil.Decode(json.Signature) sigNoID := sig[:len(sig)-1] + // TODO: // According to the Vault_ID and Entry_ID, find the Signer's Public key from database + + // According to Vault_ ID Get the public key from the client's diddocument pubk := "0x049a7df67f79246283fdc93af76d4f8cdd62c4886e8cd870944e817dd0b97934fdd7719d0810951e03418205868a5c1b40b192451367f28e0088dd75e15de40c05" pubk_byte, _ := hexutil.Decode(pubk) verified := crypto.VerifySignature(pubk_byte, hash.Bytes(), sigNoID) diff --git a/node/main.go b/node/main.go new file mode 100644 index 0000000..7691895 --- /dev/null +++ b/node/main.go @@ -0,0 +1,68 @@ +package main + +import ( + "log" + "os" + + check "github.com/bytehubplus/fusion/node/checkProof" + "github.com/bytehubplus/fusion/node/vaultRegist" + "github.com/gin-gonic/gin" +) + +func main() { + + file, err := os.Open("private.pem") + defer file.Close() + if err != nil { + log.Fatal(err) + } + // Get file information + info, err := file.Stat() + if err != nil { + log.Fatal(err) + } + // Create a slice to store the public key information read from the file + privateKey := make([]byte, info.Size()) + // Read public key file + file.Read(privateKey) + file.Close() + + file, err = os.Open("public.pem") + defer file.Close() + if err != nil { + log.Fatal(err) + } + // Get file information + info, err = file.Stat() + if err != nil { + log.Fatal(err) + } + // Create a slice to store the public key information read from the file + publicKey := make([]byte, info.Size()) + // Read public key file + file.Read(publicKey) + file.Close() + + // Initialize an xrsa instance and decrypt the received message with node's public key. + // function CreateKeys() will create 2 file to save public and private key. + /* + publicKey := bytes.NewBufferString("") + privateKey := bytes.NewBufferString("") + err := xrsa.CreateKeys(publicKey, privateKey, 2048) + if err != nil { + log.Println(err) + return + } + */ + + err = vaultRegist.CreateRSAentry(publicKey, privateKey) + if err != nil { + log.Fatal(err) + } + + r := gin.Default() + r.POST("/register", vaultRegist.RegistVault) + r.POST("/register_safe", vaultRegist.RegistVault_safe) + r.POST("/checkproof", check.CheckProof) + r.Run(":8080") +} diff --git a/node/private.pem b/node/private.pem new file mode 100644 index 0000000..c14e7e4 --- /dev/null +++ b/node/private.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWacO9MIaiynnZ +pclcQ51k9vesOZuT2hr4Pt21Ip/39oGoPg+2jCXXbBlf6+KoT8qr7/MrNWzFZs4J +5ykm/l/bSbbRm1XcGG4TjRa8Kk5JXKK+de0h3tUf5rDh6erbgNlji6YR9jck3F3W +PbmYuUFzzJuW+eOz+LiMbnq6sDkgvXINYOzpM67Yj0CYc+Ni7lr54SsYc5YV8N5b +Qr85Bot4TxSrOLZYZqMZQZTyMTny/efIYyEf7HqQy5WX010QrPIaatwQiJAXQfq4 +9jp7XHJYjuPdy//SdS2h9E1b/T/kycGtxMRFauw1CufSPu44+u1S4Xw50T4oiZQu +r2h5QZdlAgMBAAECggEAUwP+x41f0btksy5gS276EL6KBeEpr9nB5t9zqER6+/Vu +rDfMnlkNja8Y9isPxwt69ZiSondzGCRcdXTC7sWYjERMBbXxFm/ZWSsWsDW9TZo2 +LF6TyYzeHiRJ3fYn7IxZ7yolN2aoGs0RcWxR4ivlJw93lEVJWoxc9w0G6cDXVuy/ +x1RVZvFLfHdBwlJhUjDMDtI1m+qlz2CBJRvlbZCkJDHAs3U8IzWRxeMt5AUQNHbq +gCJFpS0IO5CR5hazuj2l2sEho+qbO4aSYC/AB4SEm8ptBrY0TA+SBM7hQKNcOrZG +h7DHiinKMrXAtS73iHViF8vYTwjpYR+9sBVB8GMlgQKBgQDF+tihbwb6k+Wihqoz +zusl+6Yk4MdfX04v9tV16DBkaBkCmSVv1+se0UPbPDIEfM2zx6YNs5YrXdsavJU1 +OYltEmql3kenER7DUUOZ/7J3xwbiUS0E29yiAPoJl1NEf49Crawf9ukEgV9b8V2A +sOn6AiGKXaWD4c8NanekJAO8xQKBgQDCfksj3qCsRbgMAAW4PKsY+Ar+Tc8tsH8/ +YnHlqVGg7L1UTOAktCZ3dBzPtNRWwB5yKgXwsqWx2RIdrwLj1xnHxOgCzmjclK/N +8B9ka+t1d4rfrOn6/yy7wMqpPAzFRfiA+3jzYkeVgBNVup84THXNAsGZo9NIy6Zx +HE/Q61VaIQKBgQC2nA5usLsOK5aW14FsMgJBUaFIyK/87ypuIU146MaiBkZzWBDo +3Y64KSter2IvM3KEzbUDVE9CBtsPCTzTEBQLL/6AqcsLdUYbv/wLsobJ5iEaZOeS +YL1cDGyUpiieuM3KIejuvs7lYfM0Gig1iHj4KjkHqCL/xys046whETsFRQKBgEaM +QP0119olP+k6aNi3SOi5sGMmHixYhQ+cyeugSzewJ8zYRcWKgxl5SKoe0ZbWATUw +AQ+Z/XhRYLzbqpSyhWttBStfa7H3TP3KR9jJPJNTVVBlDEo7HSLNf7V7TraP9t/y +V6EQ2R5lYp4KH47wTRqcEVWFkzIojKsiteD2O/OBAoGACo1bnC4CJo9zpXVB/no1 ++TUJSAXdCBThxJ/n6ADiBJ7e4nixO7EjOzdRLkFSY/XqB7Qob6sz0oIKsLdzIYzI +HU2/x53f1H0Kps+ViCEeV7v9dlPzpw9KbG4HaPnfOJIOYlD3mmzSSd245TRrqWpY +bjluVAchFOtRbBKv7QCsz88= +-----END PRIVATE KEY----- diff --git a/node/public.pem b/node/public.pem new file mode 100644 index 0000000..2de319d --- /dev/null +++ b/node/public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlmnDvTCGosp52aXJXEOd +ZPb3rDmbk9oa+D7dtSKf9/aBqD4Ptowl12wZX+viqE/Kq+/zKzVsxWbOCecpJv5f +20m20ZtV3BhuE40WvCpOSVyivnXtId7VH+aw4enq24DZY4umEfY3JNxd1j25mLlB +c8yblvnjs/i4jG56urA5IL1yDWDs6TOu2I9AmHPjYu5a+eErGHOWFfDeW0K/OQaL +eE8Uqzi2WGajGUGU8jE58v3nyGMhH+x6kMuVl9NdEKzyGmrcEIiQF0H6uPY6e1xy +WI7j3cv/0nUtofRNW/0/5MnBrcTERWrsNQrn0j7uOPrtUuF8OdE+KImULq9oeUGX +ZQIDAQAB +-----END PUBLIC KEY----- diff --git a/node/sendDID/go.mod b/node/sendDID/go.mod new file mode 100644 index 0000000..0643760 --- /dev/null +++ b/node/sendDID/go.mod @@ -0,0 +1,9 @@ +module fusion/node/sendDID + +go 1.16 + +require ( + golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458 + google.golang.org/grpc v1.50.0 + google.golang.org/protobuf v1.28.1 +) diff --git a/node/sendDID/go.sum b/node/sendDID/go.sum new file mode 100644 index 0000000..2e830d0 --- /dev/null +++ b/node/sendDID/go.sum @@ -0,0 +1,133 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458 h1:MgJ6t2zo8v0tbmLCueaCbF1RM+TtB0rs3Lv8DGtOIpY= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.50.0 h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/node/sendDID/peer/main.go b/node/sendDID/peer/main.go new file mode 100644 index 0000000..980de66 --- /dev/null +++ b/node/sendDID/peer/main.go @@ -0,0 +1,93 @@ +// Use gRPC to send the diddocument between two nodes. +package main + +// server + +import ( + "encoding/json" + "flag" + "fmt" + "net" + + "fusion/node/sendDID/proto/pb/proto_demo" + + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/grpclog" +) + +const ( + // gRPC服务地址 + Address = "127.0.0.1:9988" +) + +type helloService struct{} + +var HelloService = helloService{} + +func (h helloService) ProcessRequest(ctx context.Context, in *proto_demo.SignedRequest) (*proto_demo.SignedResponse, error) { + resp := new(proto_demo.SignedResponse) + requestBytes := "This is RequestBytes from server." + signature := "This is Signature from server." + resp.RequestBytes, resp.Signature = []byte(requestBytes), []byte(signature) + return resp, nil +} + +func (h helloService) HandleRequest_DID(ctx context.Context, in *proto_demo.SignedRequest) (*proto_demo.DID, error) { + resDID := new(proto_demo.DID) + scheme := "did:example:q7ckgxeq1lxmra0r" + method := []string{ + "id: did:example:123#z6MkpzW2izkFjNwMBwwvKqmELaQcH8t54QL5xmBdJg9Xh1y4", + "type: Ed25519VerificationKey2018", + "controller: did:example:123", + "publicKeyBase58: BYEz8kVpPqSt5T7DeGoPVUrcTZcDeX5jGkGhUQBWmoBg", + } + methodSpecificID := "controller: did:example:123" + sc, _ := json.Marshal(scheme) + me, _ := json.Marshal(method) + meth, _ := json.Marshal(methodSpecificID) + resDID.Scheme, resDID.Method, resDID.MethodSpecificID = sc, me, meth + return resDID, nil +} + +func main() { + var user string + flag.StringVar(&user, "u", "", "默认为启动服务端") + flag.Parse() + if user == "client" { + conn, err := grpc.Dial(Address, grpc.WithInsecure()) + if err != nil { + grpclog.Fatalln(err) + } + defer conn.Close() + + c := proto_demo.NewHandleClient(conn) + + req := &proto_demo.SignedRequest{ + RequestBytes: []byte("This is RequestBytes from client"), + Signature: []byte("This is Signature"), + } + res, err := c.HandleRequest_DID(context.Background(), req) + if err != nil { + grpclog.Fatalln(err) + } + + fmt.Printf("%v\n", string(res.Scheme)) + fmt.Printf("%v\n", string(res.Method)) + fmt.Printf("%v\n", string(res.MethodSpecificID)) + } else if user == "server" { + listen, err := net.Listen("tcp", Address) + if err != nil { + grpclog.Fatalf("Failed to listen: %v", err) + } + + s := grpc.NewServer() + + proto_demo.RegisterHandleServer(s, HelloService) + fmt.Println("Listen on " + Address) + //grpclog.Println("Listen on " + Address) + s.Serve(listen) + } else { + fmt.Println("Value of \"user\"(-u) should be \"client\" or \"server\"") + } +} diff --git a/node/sendDID/proto/did.proto b/node/sendDID/proto/did.proto new file mode 100644 index 0000000..a50cb77 --- /dev/null +++ b/node/sendDID/proto/did.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +option go_package = "pb/proto_demo"; + +package proto; + +message DID { + + // Scheme is always "did" + bytes Scheme = 1; + + // Method is the specific DID methods + bytes Method = 2; + + // MethodSpecificID is the unique ID computed or assigned by the DID method + bytes MethodSpecificID = 3; +} diff --git a/node/sendDID/proto/pb/proto_demo/did.pb.go b/node/sendDID/proto/pb/proto_demo/did.pb.go new file mode 100644 index 0000000..cb4923c --- /dev/null +++ b/node/sendDID/proto/pb/proto_demo/did.pb.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.4 +// source: did.proto + +package proto_demo + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type DID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Scheme is always "did" + Scheme []byte `protobuf:"bytes,1,opt,name=Scheme,proto3" json:"Scheme,omitempty"` + // Method is the specific DID methods + Method []byte `protobuf:"bytes,2,opt,name=Method,proto3" json:"Method,omitempty"` + // MethodSpecificID is the unique ID computed or assigned by the DID method + MethodSpecificID []byte `protobuf:"bytes,3,opt,name=MethodSpecificID,proto3" json:"MethodSpecificID,omitempty"` +} + +func (x *DID) Reset() { + *x = DID{} + if protoimpl.UnsafeEnabled { + mi := &file_did_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DID) ProtoMessage() {} + +func (x *DID) ProtoReflect() protoreflect.Message { + mi := &file_did_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DID.ProtoReflect.Descriptor instead. +func (*DID) Descriptor() ([]byte, []int) { + return file_did_proto_rawDescGZIP(), []int{0} +} + +func (x *DID) GetScheme() []byte { + if x != nil { + return x.Scheme + } + return nil +} + +func (x *DID) GetMethod() []byte { + if x != nil { + return x.Method + } + return nil +} + +func (x *DID) GetMethodSpecificID() []byte { + if x != nil { + return x.MethodSpecificID + } + return nil +} + +var File_did_proto protoreflect.FileDescriptor + +var file_did_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x64, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x61, 0x0a, 0x03, 0x44, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x49, 0x44, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x10, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x63, 0x49, 0x44, 0x42, 0x0f, 0x5a, 0x0d, 0x70, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x5f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_did_proto_rawDescOnce sync.Once + file_did_proto_rawDescData = file_did_proto_rawDesc +) + +func file_did_proto_rawDescGZIP() []byte { + file_did_proto_rawDescOnce.Do(func() { + file_did_proto_rawDescData = protoimpl.X.CompressGZIP(file_did_proto_rawDescData) + }) + return file_did_proto_rawDescData +} + +var file_did_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_did_proto_goTypes = []interface{}{ + (*DID)(nil), // 0: proto.DID +} +var file_did_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_did_proto_init() } +func file_did_proto_init() { + if File_did_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_did_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_did_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_did_proto_goTypes, + DependencyIndexes: file_did_proto_depIdxs, + MessageInfos: file_did_proto_msgTypes, + }.Build() + File_did_proto = out.File + file_did_proto_rawDesc = nil + file_did_proto_goTypes = nil + file_did_proto_depIdxs = nil +} diff --git a/node/sendDID/proto/pb/proto_demo/peer.pb.go b/node/sendDID/proto/pb/proto_demo/peer.pb.go new file mode 100644 index 0000000..16f527c --- /dev/null +++ b/node/sendDID/proto/pb/proto_demo/peer.pb.go @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.4 +// source: peer.proto + +package proto_demo + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_peer_proto protoreflect.FileDescriptor + +var file_peer_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x09, 0x64, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x48, 0x0a, + 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x3f, 0x0a, 0x06, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x12, 0x35, 0x0a, 0x11, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x44, 0x49, 0x44, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x49, 0x44, 0x42, 0x0f, 0x5a, 0x0d, 0x70, 0x62, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var file_peer_proto_goTypes = []interface{}{ + (*SignedRequest)(nil), // 0: proto.SignedRequest + (*SignedResponse)(nil), // 1: proto.SignedResponse + (*DID)(nil), // 2: proto.DID +} +var file_peer_proto_depIdxs = []int32{ + 0, // 0: proto.Process.ProcessRequest:input_type -> proto.SignedRequest + 0, // 1: proto.Handle.HandleRequest_DID:input_type -> proto.SignedRequest + 1, // 2: proto.Process.ProcessRequest:output_type -> proto.SignedResponse + 2, // 3: proto.Handle.HandleRequest_DID:output_type -> proto.DID + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_peer_proto_init() } +func file_peer_proto_init() { + if File_peer_proto != nil { + return + } + file_request_proto_init() + file_response_proto_init() + file_did_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_peer_proto_goTypes, + DependencyIndexes: file_peer_proto_depIdxs, + }.Build() + File_peer_proto = out.File + file_peer_proto_rawDesc = nil + file_peer_proto_goTypes = nil + file_peer_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// ProcessClient is the client API for Process service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ProcessClient interface { + ProcessRequest(ctx context.Context, in *SignedRequest, opts ...grpc.CallOption) (*SignedResponse, error) +} + +type processClient struct { + cc grpc.ClientConnInterface +} + +func NewProcessClient(cc grpc.ClientConnInterface) ProcessClient { + return &processClient{cc} +} + +func (c *processClient) ProcessRequest(ctx context.Context, in *SignedRequest, opts ...grpc.CallOption) (*SignedResponse, error) { + out := new(SignedResponse) + err := c.cc.Invoke(ctx, "/proto.Process/ProcessRequest", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProcessServer is the server API for Process service. +type ProcessServer interface { + ProcessRequest(context.Context, *SignedRequest) (*SignedResponse, error) +} + +// UnimplementedProcessServer can be embedded to have forward compatible implementations. +type UnimplementedProcessServer struct { +} + +func (*UnimplementedProcessServer) ProcessRequest(context.Context, *SignedRequest) (*SignedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProcessRequest not implemented") +} + +func RegisterProcessServer(s *grpc.Server, srv ProcessServer) { + s.RegisterService(&_Process_serviceDesc, srv) +} + +func _Process_ProcessRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProcessServer).ProcessRequest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Process/ProcessRequest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProcessServer).ProcessRequest(ctx, req.(*SignedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Process_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Process", + HandlerType: (*ProcessServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ProcessRequest", + Handler: _Process_ProcessRequest_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "peer.proto", +} + +// HandleClient is the client API for Handle service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type HandleClient interface { + HandleRequest_DID(ctx context.Context, in *SignedRequest, opts ...grpc.CallOption) (*DID, error) +} + +type handleClient struct { + cc grpc.ClientConnInterface +} + +func NewHandleClient(cc grpc.ClientConnInterface) HandleClient { + return &handleClient{cc} +} + +func (c *handleClient) HandleRequest_DID(ctx context.Context, in *SignedRequest, opts ...grpc.CallOption) (*DID, error) { + out := new(DID) + err := c.cc.Invoke(ctx, "/proto.Handle/HandleRequest_DID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HandleServer is the server API for Handle service. +type HandleServer interface { + HandleRequest_DID(context.Context, *SignedRequest) (*DID, error) +} + +// UnimplementedHandleServer can be embedded to have forward compatible implementations. +type UnimplementedHandleServer struct { +} + +func (*UnimplementedHandleServer) HandleRequest_DID(context.Context, *SignedRequest) (*DID, error) { + return nil, status.Errorf(codes.Unimplemented, "method HandleRequest_DID not implemented") +} + +func RegisterHandleServer(s *grpc.Server, srv HandleServer) { + s.RegisterService(&_Handle_serviceDesc, srv) +} + +func _Handle_HandleRequest_DID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandleServer).HandleRequest_DID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Handle/HandleRequest_DID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandleServer).HandleRequest_DID(ctx, req.(*SignedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Handle_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Handle", + HandlerType: (*HandleServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "HandleRequest_DID", + Handler: _Handle_HandleRequest_DID_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "peer.proto", +} diff --git a/node/sendDID/proto/pb/proto_demo/request.pb.go b/node/sendDID/proto/pb/proto_demo/request.pb.go new file mode 100644 index 0000000..dd4fd8d --- /dev/null +++ b/node/sendDID/proto/pb/proto_demo/request.pb.go @@ -0,0 +1,232 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.4 +// source: request.proto + +package proto_demo + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// import "google/protobuf/timestamp.proto"; +type SignedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bytes of Request + RequestBytes []byte `protobuf:"bytes,1,opt,name=Request_bytes,json=RequestBytes,proto3" json:"Request_bytes,omitempty"` + // Signaure over RequestBytes; this signature is to be verified against + // the creator identity contained in the header of the Request message + // marshaled as RequestBytes + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedRequest) Reset() { + *x = SignedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedRequest) ProtoMessage() {} + +func (x *SignedRequest) ProtoReflect() protoreflect.Message { + mi := &file_request_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedRequest.ProtoReflect.Descriptor instead. +func (*SignedRequest) Descriptor() ([]byte, []int) { + return file_request_proto_rawDescGZIP(), []int{0} +} + +func (x *SignedRequest) GetRequestBytes() []byte { + if x != nil { + return x.RequestBytes + } + return nil +} + +func (x *SignedRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The header of the request. It is the bytes of the Header + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The payload of the request as defined by the type in the Request + // header. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *Request) Reset() { + *x = Request{} + if protoimpl.UnsafeEnabled { + mi := &file_request_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Request) ProtoMessage() {} + +func (x *Request) ProtoReflect() protoreflect.Message { + mi := &file_request_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Request.ProtoReflect.Descriptor instead. +func (*Request) Descriptor() ([]byte, []int) { + return file_request_proto_rawDescGZIP(), []int{1} +} + +func (x *Request) GetHeader() []byte { + if x != nil { + return x.Header + } + return nil +} + +func (x *Request) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +var File_request_proto protoreflect.FileDescriptor + +var file_request_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x3b, 0x0a, 0x07, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x0f, 0x5a, 0x0d, 0x70, 0x62, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_request_proto_rawDescOnce sync.Once + file_request_proto_rawDescData = file_request_proto_rawDesc +) + +func file_request_proto_rawDescGZIP() []byte { + file_request_proto_rawDescOnce.Do(func() { + file_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_request_proto_rawDescData) + }) + return file_request_proto_rawDescData +} + +var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_request_proto_goTypes = []interface{}{ + (*SignedRequest)(nil), // 0: proto.SignedRequest + (*Request)(nil), // 1: proto.Request +} +var file_request_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_request_proto_init() } +func file_request_proto_init() { + if File_request_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_request_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_request_proto_goTypes, + DependencyIndexes: file_request_proto_depIdxs, + MessageInfos: file_request_proto_msgTypes, + }.Build() + File_request_proto = out.File + file_request_proto_rawDesc = nil + file_request_proto_goTypes = nil + file_request_proto_depIdxs = nil +} diff --git a/node/sendDID/proto/pb/proto_demo/response.pb.go b/node/sendDID/proto/pb/proto_demo/response.pb.go new file mode 100644 index 0000000..edfbf61 --- /dev/null +++ b/node/sendDID/proto/pb/proto_demo/response.pb.go @@ -0,0 +1,252 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.4 +// source: response.proto + +package proto_demo + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// import "google/protobuf/timestamp.proto"; +type SignedResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bytes of Request + RequestBytes []byte `protobuf:"bytes,1,opt,name=Request_bytes,json=RequestBytes,proto3" json:"Request_bytes,omitempty"` + // Signaure over RequestBytes; this signature is to be verified against + // the creator identity contained in the header of the Request message + // marshaled as RequestBytes + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedResponse) Reset() { + *x = SignedResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedResponse) ProtoMessage() {} + +func (x *SignedResponse) ProtoReflect() protoreflect.Message { + mi := &file_response_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedResponse.ProtoReflect.Descriptor instead. +func (*SignedResponse) Descriptor() ([]byte, []int) { + return file_response_proto_rawDescGZIP(), []int{0} +} + +func (x *SignedResponse) GetRequestBytes() []byte { + if x != nil { + return x.RequestBytes + } + return nil +} + +func (x *SignedResponse) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// A Request is sent to an endorser for endorsement. The Request contains: +// 1. A header which should be unmarshaled to a Header message. Note that +// Header is both the header of a Request and of a Transaction, in that i) +// both headers should be unmarshaled to this message; and ii) it is used to +// compute cryptographic hashes and signatures. The header has fields common +// to all Requests/transactions. In addition it has a type field for +// additional customization. An example of this is the ChaincodeHeaderExtension +// message used to extend the Header for type CHAINCODE. +// 2. A payload whose type depends on the header's type field. +// 3. An extension whose type depends on the header's type field. +// +// Let us see an example. For type CHAINCODE (see the Header message), +// we have the following: +// 1. The header is a Header message whose extensions field is a +// ChaincodeHeaderExtension message. +// 2. The payload is a Chaincod RequestPayload message. +// 3. The extension is a ChaincodeAction that might be used to ask the +// endorsers to endorse a specific ChaincodeAction, thus emulating the +// submitting peer model. +type Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The header of the Request. It is the bytes of the Header + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The payload of the Request as defined by the type in the Request + // header. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *Response) Reset() { + *x = Response{} + if protoimpl.UnsafeEnabled { + mi := &file_response_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_response_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_response_proto_rawDescGZIP(), []int{1} +} + +func (x *Response) GetHeader() []byte { + if x != nil { + return x.Header + } + return nil +} + +func (x *Response) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +var File_response_proto protoreflect.FileDescriptor + +var file_response_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1c, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x3c, 0x0a, 0x08, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x0f, 0x5a, 0x0d, 0x70, 0x62, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_response_proto_rawDescOnce sync.Once + file_response_proto_rawDescData = file_response_proto_rawDesc +) + +func file_response_proto_rawDescGZIP() []byte { + file_response_proto_rawDescOnce.Do(func() { + file_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_response_proto_rawDescData) + }) + return file_response_proto_rawDescData +} + +var file_response_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_response_proto_goTypes = []interface{}{ + (*SignedResponse)(nil), // 0: proto.SignedResponse + (*Response)(nil), // 1: proto.Response +} +var file_response_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_response_proto_init() } +func file_response_proto_init() { + if File_response_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_response_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_response_proto_goTypes, + DependencyIndexes: file_response_proto_depIdxs, + MessageInfos: file_response_proto_msgTypes, + }.Build() + File_response_proto = out.File + file_response_proto_rawDesc = nil + file_response_proto_goTypes = nil + file_response_proto_depIdxs = nil +} diff --git a/node/sendDID/proto/peer.proto b/node/sendDID/proto/peer.proto new file mode 100644 index 0000000..52cfafc --- /dev/null +++ b/node/sendDID/proto/peer.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +option go_package = "pb/proto_demo"; + +package proto; + +import "request.proto"; +import "response.proto"; +import "did.proto"; + +service Process { + rpc ProcessRequest(SignedRequest) returns (SignedResponse); +} + +service Handle { + rpc HandleRequest_DID (SignedRequest) returns (DID); +} \ No newline at end of file diff --git a/node/sendDID/proto/request.proto b/node/sendDID/proto/request.proto new file mode 100644 index 0000000..18bceec --- /dev/null +++ b/node/sendDID/proto/request.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +option go_package = "pb/proto_demo"; + +package proto; + +/* import "google/protobuf/timestamp.proto"; */ +message SignedRequest { + + // The bytes of Request + bytes Request_bytes = 1; + + // Signaure over RequestBytes; this signature is to be verified against + // the creator identity contained in the header of the Request message + // marshaled as RequestBytes + bytes signature = 2; +} + +message Request { + + // The header of the request. It is the bytes of the Header + bytes header = 1; + + // The payload of the request as defined by the type in the Request + // header. + bytes payload = 2; + +} diff --git a/node/sendDID/proto/response.proto b/node/sendDID/proto/response.proto new file mode 100644 index 0000000..cb90b9a --- /dev/null +++ b/node/sendDID/proto/response.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +option go_package = "pb/proto_demo"; + +package proto; + +/* import "google/protobuf/timestamp.proto"; */ +message SignedResponse { + + // The bytes of Request + bytes Request_bytes = 1; + + // Signaure over RequestBytes; this signature is to be verified against + // the creator identity contained in the header of the Request message + // marshaled as RequestBytes + bytes signature = 2; +} + +// A Request is sent to an endorser for endorsement. The Request contains: +// 1. A header which should be unmarshaled to a Header message. Note that +// Header is both the header of a Request and of a Transaction, in that i) +// both headers should be unmarshaled to this message; and ii) it is used to +// compute cryptographic hashes and signatures. The header has fields common +// to all Requests/transactions. In addition it has a type field for +// additional customization. An example of this is the ChaincodeHeaderExtension +// message used to extend the Header for type CHAINCODE. +// 2. A payload whose type depends on the header's type field. +// 3. An extension whose type depends on the header's type field. +// +// Let us see an example. For type CHAINCODE (see the Header message), +// we have the following: +// 1. The header is a Header message whose extensions field is a +// ChaincodeHeaderExtension message. +// 2. The payload is a Chaincod RequestPayload message. +// 3. The extension is a ChaincodeAction that might be used to ask the +// endorsers to endorse a specific ChaincodeAction, thus emulating the +// submitting peer model. +message Response { + + // The header of the Request. It is the bytes of the Header + bytes header = 1; + + // The payload of the Request as defined by the type in the Request + // header. + bytes payload = 2; +} diff --git a/node/vaultRegist/README.md b/node/vaultRegist/README.md new file mode 100644 index 0000000..1df8160 --- /dev/null +++ b/node/vaultRegist/README.md @@ -0,0 +1,155 @@ +# 加密模式 + +使用"xrsa"库里的RSA加密函数创建公钥私钥保存为public.pem和private.pem两个文件以便后续的使用。在发送过程中默认Client已知Node端的公钥,Client发送的消息还需要附带自己的公钥。Client端需要发送的消息格式为: + +{ + + "Email": "" , + + "Phone": "" , + + "DID": "" , + + "Pubkey": "" + +} + +4个参数均为string类型。 + +其中DID是经过双重加密的document文档的密文。首先用Client的私钥进行加密获得密文encry1,然后用Node端的公钥加密获得DID。 + +以下是Client端发送的消息实例: + +{ + + "Email": "123456@gmail.com" , + + "Phone": "123456789" , + + "DID": "Q3h3e4mhyAjOgRJfRe7z0cti53U6-g9ADjbK4oFaCAYE-WALV2CTwT7-xqxi2P8d5O94q9NlNgsmjJm5XHuFE-26D8z8H-TilU1n_YANejicmJ_jH5vVAKIA8V98uJLXQOmEpnjw3Anl-qfCPokBZahFZ9AUNm5XrQeO6GR0C7s3u8BD3T-azju1Rk5NeseCHCusBHfW8i1VsWm2coRibzREGslyiRjiV-QUviOwLxWvo3E43QJllSJIXLCmsAYEZrqi8Q2ebOuEUJpuslsHyxcdJkXceD4gr-Mu-KgKEzKp76Umg5_tBifyLgKw2ZF1AT_rI0OLVtG_7_JmNcNemBOL2uhneQSX_A_LseC-a06DhI9RVhbYjooPNofDcmqtInfGj6gdyU4mCyrSQggWhrmsuBtIBIEt3_wF4ipyIE7bP282Qlcfeu368WSxu4u_w9gK1I7ol31R_Mp_ISV_Ni_XcSMdWQhG14ic3hsA-axVUJmxbKR3C4eZJMgnyXd1JleGyihhGu8VOdaXW4WVPNkPkv-vJZAHBr_I5z7fPDIYJhXNd5S2GU79GrNZ2JxynpYgxIfbedthhV2g_WWv11g0lp6laHx1oLbCQpGqvA-lLBG3yrMAZzOW7qp-6rgl49wmTtGDGYNNQtJgjtnDrT1dL6HsgC-no2SSvyJ3tNVjK2_9vCMqZYvNCxV40gpxZml8CbLipnMCJJYD7lcZwDOZZX6FWze9dnOli-DAkRnkCIA1RdocA2VAv8k6qRGmMvLUT9Dg6aRPt8ZtMekUuTYEWcbbgR_9Mm7jjGp8gmQ8mJV_Q_XgRxySPb64z59qDN9kOJzhjYaNCp_KvmolILJWGPYYAK8PuE7X2MLNB5b5h5qJy7ntf5JKCbp79zT8q13yJ61u-M1bODiszsRHQH8xX1042yx30mX1RPIQvUBN_pcmYlOfKir3_BVm4XlU5c2Kf4k8L74Q2HUf7I-Cmi7WLaLPMoXiTES2JN66puRw7vk5CM5y1fQvrL6eteAXiUCarXQ7vPKBedRSj0E4jh5nqO1YlgwXHqSCtnYGuIo8T1WM8hplfvwx-tUwN-4oruwomJSF0bpu67ll3Hof0Dxbtfd53yvX5Q4hhQL_eelLOl6qvK7RQXMyV9UdxOe7eFE7tlM8I8d-r07woPZCyKwAd-FS6WRTi1jyvYnHEz4sjnLHPbl6eGU9mfkZ5mVWZ8jmOy0r_7-7AbsRIyl9mfbA-oSc4UhxcBsYY_2thjMaV1f9DNBmfNVcGSfICrIBNzO0xQxIrBH81OBlABTqwJcNHIccUNAKLgaRJG32VmtNnLNFhWFlh-RcVD8S_Ez6qrVfAmnpp3D4qPVEfbfwSoc9AfakAE_1jv-p0nlZ-tssZ6vALVQOwgXm7ul2-HVqswm1zB3tTd9AnJEc4M5cIqjyAN365-aPCepy31m4AM7Z8oiCrdoGOJMv64mxa1yl_4agPt3JhZfxOWcgErYcEDYu6ZkjAUXHyfIGpMuyMHpuItFjW22faGbmVMD0WtMpDnMHZy96MiF3mVMNFxQ5XVQhG9pC_HAwH_D6jpQGLzMfM4ffPl9SNcz4K7RCxOE5VKqeq1PwWX5jkUm2OmrT6tEeJefRynKRd0aQW9lDlpbpxzK5vfu4NlGAOJB8m_CWnrNgflQtwo2fwVOzOuohFCGT1hd-JjkgJNtFj2xXl_tv5wX3V7SoX-xCQmh5p8nC3UNLLs3JwlDdGTSvLV63tJHDJM23C6HUpb5E9MG0kqh6m7v-FzzUekluGnhjxWYfgcXGBWc1c-CSzESQ2VjXsEu__ss95yVUod3HKzoO8i4wdXBPiXc9Qu4d_JMdMTz8dtvZjlEnavfyOYKeP0XYGwmUc5LBuGD-CfWctKAZCaFXFIikG5xQ_zn9PxltdZWgA3HTYZyKGSJl_Pip0DzMIFBGbVVjlTl9j3_XxA16Xm2NKTqHrWkrw2MUe-bSkfbyxMEOuGcXeSDDdSCaAcAl8jrcbz3auS5V8aCJNxwKZgMI63vsj5vPqMQyNQEAMa66PfH_0CJf265UnMrmLT71fSeCZ3bdzvOPuL9dfJHTGIsN7Vd-jJBCqBlyuI_eaCWkywYDZu-TAzqqshIGVx8MzWiyWuXzIOiN9O9qj2mRGNA9_vbq0ezEwrUGQU5YndI86GJTPGKjQYu-xCFpbi9HXQ2Ht-32mpPCbB1C2gshSXR9ehcZ1k_fJuRBFkIHNgNagPdhAcSl9ZKjUhDaByJnKcGPyjBMWaKoyPDU5TR5_troEX03Bu_pifv7yuNIWr_kn9UfmT4HSf5TbbVNvxywqAUlk5FJGYLBOPRLqR3E4jOqyAwdmKttMWMp5bu7PHkxdwYGpTB1h8GrmjCFK6tt-EidMQ_bqdakuE--5YZZUYKXC_Do8MGjjaDhajUGDkr-G8Xqre699h4tY3A3OLQhDGZ01A34OEDw3hYqSoHNurAhyUatG2ZEtO2ueS4PZQhcTyhwQ8_1jNwGDhz_6RdCQGOF7TQFi7OfGPeY0h-WMWDknCdSo50jBPUm1nQ5q9ceXjQgwuEzRX4wJXZgFmE41BRrWcpTTqt0UoDZxGteMuB6fgiTJs-t4uVKkabL5H65rrNr6Pu4Qeeyq0bpkKDBYkWITVEvJ76IVyJYX4xbgzVTPHL_GK9_wISx0wKF8VdHxDh-26TeogE3hQSEAmNNbtReBNRN35EJNyZMhehlBnxXigSJjLf6BdQ_H8VD_O4jKgPxt5dJPEsygYpK2zPnIYeamT-5rlVq8xqcwEX9RrDGrt5mbF-uqU12M9AkPBKIlUCYCTmMFqySlM1vgNUR3FKYmfiQwJXY0pebg6FpWxNqCVGlyfYNbJN3jHtFp-tk3J91VVoVLwLTteU52j4pM1W35bgfs2xcaqJxTpM3sEZ-C5STkxCxmKyLCafTF8UI0O46yM73mSfC0jOCPqIE4zyYINrjKmz7s5w5QbvrcZELueVozKFR5LK0MnsPGonkD6s2CalZC2-RcOmNrvJPCwB0wK8vgXXm7SIjT4rF5QcNJQ0e8G2BHoqujvunx1emEErcKBbYYA9ITE1T0eFmj0enKECJhAPUrc4MUuqFoVULuj0lhENJ5UGPc3KY81iShrMtzwJ41Z-D7AVDhaLi3iaPpYJLALk7aOVQ-N9RhaxYBQi0PTuCc57IocrOapNN91pusHUFId2g87vIsuJVfZ4pdmw3WNnGUTPBTdbfICn3dMwUJLFv-fVdRYLNRDlSeXmzV67n9GPFNs7Tu0bLBE52YDe-kA9gK3MyKR-5kXcnw0swcJzVDuUy8rqqysD5gpAYBxDUOLQ065qRbLwVrk42sVQPYiHjAI6iaaFI0W_ajxqS-uyelocS00hcb4H9EHakpo8YXvYIR5svhiboNA" , + + "Pubkey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoTdbcYcLggJjzpQ/0b4A\n67RDQqvZTvAAfE9K8vilwOs0AkMX1RWm3GqIGCrexc9clW0a9uGw9XwFiB7HNfcB\nGhIMIa+5Q5nczbPTFESl4ssLkM9TPBCSJ4Pt9fEEF5TwBgFirBqQ6CMd0U2jg24y\n8YFuTdFMfiSAixReahlIu7lyaMbR8oG3R6ecTbCC6P/5GM9pIeQFWHN3wwf1YQqf\naleWT/TcUJf5NL0o3E49guoS0c3ZMBNkp2A2vO2BGXb6w2HhdNfja0CdiH4Tx+rS\nLby9IAIGvxCu21ooazXocv2XcM8n8YG5Y2B4zdj2S7RNda0QVAecWcejh0tfP60D\ntwIDAQAB\n-----END PUBLIC KEY-----\n" + +} + +# 不加密模式 + +该模式下直接将DID document发送即可。例如: + +{ + + "@context": [ + + "https://www.w3.org/ns/did/v1" + + ], + + "id": "did:nuts:04cf1e20378a4e38ab1b401a5018c9ff", + + "controller": [ + + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + + "did:nuts:f03a00f1-9615-4060-bd00-bd282e150c46" + + ], + + "verificationMethod": [ + + { + + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + + "type": "JsonWebKey2020", + + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + + "publicKeyJwk": { + +​ "kty": "EC", + +​ "crv": "P-256", + +​ "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + +​ "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + + } + + }, + + { + + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-2", + + "type": "JsonWebKey2020", + + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + + "publicKeyJwk": { + +​ "kty": "EC", + +​ "crv": "P-256", + +​ "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + +​ "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + + } + + }, + + { + + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#added-assertion-method-1", + + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + + "publicKeyBase58": "GGRj8PAR5tRgD5xqAhPna1bLa3UoYuxNEEhRmcYCPBm5", + + "type": "Ed25519VerificationKey2018" + + } + + ], + + "authentication": [ + + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff" + + ], + + "assertionMethod": [ + + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff" + + ], + + "service": [ + + { + + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-1", + + "type": "nuts:bolt:eoverdracht", + + "serviceEndpoint": "did:nuts:#service-76" + + }, + + { + + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-2", + + "type": "nuts:core:consent", + + "serviceEndpoint": "did:nuts:123456" + + } + + ] + +} \ No newline at end of file diff --git a/node/vaultRegist/main.go b/node/vaultRegist/main.go new file mode 100644 index 0000000..4a36cc7 --- /dev/null +++ b/node/vaultRegist/main.go @@ -0,0 +1,185 @@ +package vaultRegist + +import ( + _ "embed" + "encoding/json" + "log" + "net/http" + "os" + + "xrsa" + + "github.com/bytehubplus/fusion/did" + store "github.com/bytehubplus/fusion/did/store" + "github.com/gin-gonic/gin" +) + +var ( + //go:embed test/did1.json + did1Json string +) + +type Rsa_node struct { + Xrsa *xrsa.XRsa +} + +type Message struct { + Email string + Phone string + DID string + PubKey string +} + +// Global Rsa Object +var RSAENTRY = &Rsa_node{} + +func main() { + + file, err := os.Open("private.pem") + defer file.Close() + if err != nil { + log.Println(err) + return + } + // Get file information + info, err := file.Stat() + if err != nil { + log.Println(err) + return + } + // Create a slice to store the public key information read from the file + privateKey := make([]byte, info.Size()) + // Read public key file + file.Read(privateKey) + file.Close() + + file, err = os.Open("public.pem") + defer file.Close() + if err != nil { + log.Println(err) + return + } + // Get file information + info, err = file.Stat() + if err != nil { + log.Println(err) + return + } + // Create a slice to store the public key information read from the file + publicKey := make([]byte, info.Size()) + // Read public key file + file.Read(publicKey) + file.Close() + + // Initialize an xrsa instance and decrypt the received message with node's public key. + // function CreateKeys() will create 2 file to save public and private key. + /* + publicKey := bytes.NewBufferString("") + privateKey := bytes.NewBufferString("") + err := xrsa.CreateKeys(publicKey, privateKey, 2048) + if err != nil { + log.Println(err) + return + } + */ + + RSAENTRY.Xrsa, err = xrsa.NewXRsa(publicKey, privateKey) + if err != nil { + log.Println(err) + return + } + //log.Println(publicKey.String()) + //log.Println(privateKey.String()) + + r := gin.Default() + r.POST("/register", RegistVault) + r.POST("/register_safe", RegistVault_safe) + r.Run(":8080") + +} + +func CreateRSAentry(pub, pri []byte) error { + var err error + RSAENTRY.Xrsa, err = xrsa.NewXRsa(pub, pri) + if err != nil { + return err + } else { + return nil + } +} + +func RegistVault_safe(c *gin.Context) { + postdata := Message{} + c.BindJSON(&postdata) + + //log.Println(reflect.TypeOf(postdata.pubKey)) + decrypted_node, err := RSAENTRY.Xrsa.PrivateDecrypt(postdata.DID) + if err != nil { + log.Println(err) + return + } + xrsa_client, err := xrsa.NewXRsa([]byte(postdata.PubKey), nil) + if err != nil { + log.Println(err) + return + } + decrypted, err := xrsa_client.PublicDecrypt(decrypted_node) + if err != nil { + log.Println(err) + return + } + //log.Println(decrypted) + de_byte := []byte(decrypted) + //log.Println(de_byte) + var doc did.Document + _ = json.Unmarshal(de_byte, &doc) + //log.Println(doc) + + conf := &store.StoreConfig{ + DBPath: "./data", + Schema: "did", + Method: "rich", + } + sp, err := store.NewProvider(*conf) + if err != nil { + c.JSON(200, "create store provider failed") + return + } + sto, err := sp.OpenStore() + defer sp.CloseStore() + key, err := sto.SaveDocument(doc) + if err != nil { + c.JSON(200, "Save did-document failed. please retry") + return + } + resp := "Save did-document done. the key is : " + resp = resp + key + c.JSON(http.StatusOK, resp) +} + +func RegistVault(c *gin.Context) { + postdata := did.Document{} + c.BindJSON(&postdata) + + conf := &store.StoreConfig{ + DBPath: "./data", + Schema: "did", + Method: "rich", + } + sp, err := store.NewProvider(*conf) + if err != nil { + c.JSON(200, "create store provider failed") + return + } + + sto, err := sp.OpenStore() + defer sp.CloseStore() + key, err := sto.SaveDocument(postdata) + if err != nil { + c.JSON(200, "Save did-document failed. please retry") + return + } + resp := "Save did-document done. the key is : " + resp = resp + key + c.JSON(http.StatusOK, resp) +} diff --git a/node/vaultRegist/private.pem b/node/vaultRegist/private.pem new file mode 100644 index 0000000..c14e7e4 --- /dev/null +++ b/node/vaultRegist/private.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWacO9MIaiynnZ +pclcQ51k9vesOZuT2hr4Pt21Ip/39oGoPg+2jCXXbBlf6+KoT8qr7/MrNWzFZs4J +5ykm/l/bSbbRm1XcGG4TjRa8Kk5JXKK+de0h3tUf5rDh6erbgNlji6YR9jck3F3W +PbmYuUFzzJuW+eOz+LiMbnq6sDkgvXINYOzpM67Yj0CYc+Ni7lr54SsYc5YV8N5b +Qr85Bot4TxSrOLZYZqMZQZTyMTny/efIYyEf7HqQy5WX010QrPIaatwQiJAXQfq4 +9jp7XHJYjuPdy//SdS2h9E1b/T/kycGtxMRFauw1CufSPu44+u1S4Xw50T4oiZQu +r2h5QZdlAgMBAAECggEAUwP+x41f0btksy5gS276EL6KBeEpr9nB5t9zqER6+/Vu +rDfMnlkNja8Y9isPxwt69ZiSondzGCRcdXTC7sWYjERMBbXxFm/ZWSsWsDW9TZo2 +LF6TyYzeHiRJ3fYn7IxZ7yolN2aoGs0RcWxR4ivlJw93lEVJWoxc9w0G6cDXVuy/ +x1RVZvFLfHdBwlJhUjDMDtI1m+qlz2CBJRvlbZCkJDHAs3U8IzWRxeMt5AUQNHbq +gCJFpS0IO5CR5hazuj2l2sEho+qbO4aSYC/AB4SEm8ptBrY0TA+SBM7hQKNcOrZG +h7DHiinKMrXAtS73iHViF8vYTwjpYR+9sBVB8GMlgQKBgQDF+tihbwb6k+Wihqoz +zusl+6Yk4MdfX04v9tV16DBkaBkCmSVv1+se0UPbPDIEfM2zx6YNs5YrXdsavJU1 +OYltEmql3kenER7DUUOZ/7J3xwbiUS0E29yiAPoJl1NEf49Crawf9ukEgV9b8V2A +sOn6AiGKXaWD4c8NanekJAO8xQKBgQDCfksj3qCsRbgMAAW4PKsY+Ar+Tc8tsH8/ +YnHlqVGg7L1UTOAktCZ3dBzPtNRWwB5yKgXwsqWx2RIdrwLj1xnHxOgCzmjclK/N +8B9ka+t1d4rfrOn6/yy7wMqpPAzFRfiA+3jzYkeVgBNVup84THXNAsGZo9NIy6Zx +HE/Q61VaIQKBgQC2nA5usLsOK5aW14FsMgJBUaFIyK/87ypuIU146MaiBkZzWBDo +3Y64KSter2IvM3KEzbUDVE9CBtsPCTzTEBQLL/6AqcsLdUYbv/wLsobJ5iEaZOeS +YL1cDGyUpiieuM3KIejuvs7lYfM0Gig1iHj4KjkHqCL/xys046whETsFRQKBgEaM +QP0119olP+k6aNi3SOi5sGMmHixYhQ+cyeugSzewJ8zYRcWKgxl5SKoe0ZbWATUw +AQ+Z/XhRYLzbqpSyhWttBStfa7H3TP3KR9jJPJNTVVBlDEo7HSLNf7V7TraP9t/y +V6EQ2R5lYp4KH47wTRqcEVWFkzIojKsiteD2O/OBAoGACo1bnC4CJo9zpXVB/no1 ++TUJSAXdCBThxJ/n6ADiBJ7e4nixO7EjOzdRLkFSY/XqB7Qob6sz0oIKsLdzIYzI +HU2/x53f1H0Kps+ViCEeV7v9dlPzpw9KbG4HaPnfOJIOYlD3mmzSSd245TRrqWpY +bjluVAchFOtRbBKv7QCsz88= +-----END PRIVATE KEY----- diff --git a/node/vaultRegist/public.pem b/node/vaultRegist/public.pem new file mode 100644 index 0000000..2de319d --- /dev/null +++ b/node/vaultRegist/public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlmnDvTCGosp52aXJXEOd +ZPb3rDmbk9oa+D7dtSKf9/aBqD4Ptowl12wZX+viqE/Kq+/zKzVsxWbOCecpJv5f +20m20ZtV3BhuE40WvCpOSVyivnXtId7VH+aw4enq24DZY4umEfY3JNxd1j25mLlB +c8yblvnjs/i4jG56urA5IL1yDWDs6TOu2I9AmHPjYu5a+eErGHOWFfDeW0K/OQaL +eE8Uqzi2WGajGUGU8jE58v3nyGMhH+x6kMuVl9NdEKzyGmrcEIiQF0H6uPY6e1xy +WI7j3cv/0nUtofRNW/0/5MnBrcTERWrsNQrn0j7uOPrtUuF8OdE+KImULq9oeUGX +ZQIDAQAB +-----END PUBLIC KEY----- diff --git a/node/vaultRegist/test/did1-expected.json b/node/vaultRegist/test/did1-expected.json new file mode 100644 index 0000000..06fc173 --- /dev/null +++ b/node/vaultRegist/test/did1-expected.json @@ -0,0 +1,57 @@ +{ + "@context": "https://www.w3.org/ns/did/v1", + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "controller": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "did:nuts:f03a00f1-9615-4060-bd00-bd282e150c46" + ], + "verificationMethod": [ + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-1", + "type": "JsonWebKey2020", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyJwk": { + "kty": "EC", + "crv": "P-256", + "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + } + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-2", + "type": "JsonWebKey2020", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyJwk": { + "kty": "EC", + "crv": "P-256", + "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + } + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#added-assertion-method-1", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyBase58": "GGRj8PAR5tRgD5xqAhPna1bLa3UoYuxNEEhRmcYCPBm5", + "type": "Ed25519VerificationKey2018" + } + ], + "authentication": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-1", + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-2" + ], + "assertionMethod": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-1" + ], + "service": [ + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-1", + "type": "nuts:bolt:eoverdracht", + "serviceEndpoint": "did:nuts:#service-76" + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-2", + "type": "nuts:core:consent", + "serviceEndpoint": "did:nuts:#service-2" + } + ] +} \ No newline at end of file diff --git a/node/vaultRegist/test/did1.json b/node/vaultRegist/test/did1.json new file mode 100644 index 0000000..6e70e85 --- /dev/null +++ b/node/vaultRegist/test/did1.json @@ -0,0 +1,59 @@ +{ + "@context": [ + "https://www.w3.org/ns/did/v1" + ], + "id": "did:nuts:04cf1e20378a4e38ab1b401a5018c9ff", + "controller": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "did:nuts:f03a00f1-9615-4060-bd00-bd282e150c46" + ], + "verificationMethod": [ + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "type": "JsonWebKey2020", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyJwk": { + "kty": "EC", + "crv": "P-256", + "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + } + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-2", + "type": "JsonWebKey2020", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyJwk": { + "kty": "EC", + "crv": "P-256", + "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + } + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#added-assertion-method-1", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyBase58": "GGRj8PAR5tRgD5xqAhPna1bLa3UoYuxNEEhRmcYCPBm5", + "type": "Ed25519VerificationKey2018" + } + ], + "authentication": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff" + ], + "assertionMethod": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff" + ], + "service": [ + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-1", + "type": "nuts:bolt:eoverdracht", + "serviceEndpoint": "did:nuts:#service-76" + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-2", + "type": "nuts:core:consent", + "serviceEndpoint": "did:nuts:123456" + } + ] +} \ No newline at end of file diff --git a/node/vaultRegist/test/util.go b/node/vaultRegist/test/util.go new file mode 100644 index 0000000..20b773c --- /dev/null +++ b/node/vaultRegist/test/util.go @@ -0,0 +1,13 @@ +package test + +import ( + "io/ioutil" +) + +func ReadTestFile(name string) []byte { + data, err := ioutil.ReadFile(name) + if err != nil { + panic(err) + } + return data +} diff --git a/node/vaultindex/index.go b/node/vaultindex/index.go index 547e7cd..e1e18ac 100644 --- a/node/vaultindex/index.go +++ b/node/vaultindex/index.go @@ -37,7 +37,7 @@ type IndexProvider struct { } // shorten and undetectable -func (p *IndexProvider) generateVaultID(id string) string { +func (p *IndexProvider) GenerateVaultID(id string) string { did := fmt.Sprintf("%s:%s:%s", p.Config.Scheme, p.Config.Method, id) h := sha256.Sum256([]byte(did)) return fmt.Sprintf("%x", h[:20]) @@ -45,7 +45,7 @@ func (p *IndexProvider) generateVaultID(id string) string { // register a vault, return vault ID func (i *IndexProvider) RegisterVault(id string) (string, error) { - vaultID := i.generateVaultID(id) + vaultID := i.GenerateVaultID(id) err := i.db.Put([]byte(vaultID), []byte(id), nil) if err != nil { return "", err @@ -56,7 +56,7 @@ func (i *IndexProvider) RegisterVault(id string) (string, error) { // unregiste a vault func (i *IndexProvider) UnregisterVault(id string) error { - vaultID := i.generateVaultID(id) + vaultID := i.GenerateVaultID(id) err := i.db.Delete([]byte(vaultID), nil) if err != nil { return errors.New(fmt.Sprintf("unregister vault failed: %s", err)) @@ -79,7 +79,7 @@ func NewProvider(conf Config) (*IndexProvider, error) { if err != nil { return nil, errors.New(fmt.Sprintf("failed to open database: %s", err)) } - defer l.Close() + //defer l.Close() p := &IndexProvider{Config: conf, db: l} return p, nil } diff --git a/test/ECDSA_test/main.go b/test/ECDSA_test/main.go index eb1cc0c..7f878ad 100644 --- a/test/ECDSA_test/main.go +++ b/test/ECDSA_test/main.go @@ -1,3 +1,7 @@ +// Use ECDSA algorithm to verify the signature. Users should use +// their own public key to sign and the public key is included in +// the DID document. + package main import ( @@ -10,6 +14,8 @@ import ( "github.com/ethereum/go-ethereum/crypto" ) +// Request is the type of this request. Vault_ID and Entry_ID index the data which user wants to get. +// Signature is the result of signing the above three variables. type Proof struct { Request string Vault_ID string diff --git a/test/Vault_test/main.go b/test/Vault_test/main.go new file mode 100644 index 0000000..2cc8017 --- /dev/null +++ b/test/Vault_test/main.go @@ -0,0 +1,64 @@ +package main + +import ( + "log" + + vault "github.com/bytehubplus/fusion/node/vaultindex" +) + +func main() { + TestRegisterVault() +} + +func TestRegisterVault() { + conf := vault.Config{ + Scheme: "did", + Method: "rich", + DBPath: "./data/vaultindex", + } + + provider, _ := vault.NewProvider(conf) + //defer provider.CloseDB() + vaultID, err := provider.RegisterVault("abcdef1234567") + if err != nil { + log.Printf("register failed: %s", err) + } + + log.Printf("vauld %s registered", vaultID) +} + +func TestVaultExist() { + conf := vault.Config{ + Scheme: "did", + Method: "rich", + DBPath: "./data/vaultindex", + } + + provider, _ := vault.NewProvider(conf) + //defer provider.CloseDB() + vaultID := provider.GenerateVaultID("abcdef1234567") + exist := provider.VaultExits(vaultID) + if exist { + log.Printf("Vault %s already registered", vaultID) + } else { + + log.Printf("vault %s not registered", vaultID) + } +} + +func TestUnregisterVault() { + conf := vault.Config{ + Scheme: "did", + Method: "rich", + DBPath: "./data/vaultindex", + } + + provider, _ := vault.NewProvider(conf) + //defer provider.CloseDB() + vaultID := provider.GenerateVaultID("abcdef1234567") + if err := provider.UnregisterVault(vaultID); err != nil { + log.Printf("unregister vault %s failed", err) + } else { + log.Printf("vault %s unregistered", vaultID) + } +} diff --git a/test/XRSA_test/main.go b/test/XRSA_test/main.go new file mode 100644 index 0000000..ee14a71 --- /dev/null +++ b/test/XRSA_test/main.go @@ -0,0 +1,145 @@ +// Use the XRSA library to encrypt DID documents. Before encryption, +// need to know the key of the receiver to complete the double encryption. +package main + +import ( + _ "embed" + "encoding/json" + "log" + "os" + "xrsa" + + did "github.com/bytehubplus/fusion/did" +) + +var ( + //go:embed test/did1.json + did1Json string +) + +func main() { + file, err := os.Open("private.pem") + defer file.Close() + if err != nil { + log.Println(err) + return + } + //获取文件信息 + info, err := file.Stat() + if err != nil { + log.Println(err) + return + } + //创建切片,用于存储文件中读取到的公钥信息 + privateKey := make([]byte, info.Size()) + //读取公钥文件 + file.Read(privateKey) + file.Close() + + file, err = os.Open("public.pem") + defer file.Close() + if err != nil { + log.Println(err) + return + } + //获取文件信息 + info, err = file.Stat() + if err != nil { + log.Println(err) + return + } + //创建切片,用于存储文件中读取到的公钥信息 + publicKey := make([]byte, info.Size()) + //读取公钥文件 + file.Read(publicKey) + file.Close() + + const publicKey_Bob = `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlmnDvTCGosp52aXJXEOd +ZPb3rDmbk9oa+D7dtSKf9/aBqD4Ptowl12wZX+viqE/Kq+/zKzVsxWbOCecpJv5f +20m20ZtV3BhuE40WvCpOSVyivnXtId7VH+aw4enq24DZY4umEfY3JNxd1j25mLlB +c8yblvnjs/i4jG56urA5IL1yDWDs6TOu2I9AmHPjYu5a+eErGHOWFfDeW0K/OQaL +eE8Uqzi2WGajGUGU8jE58v3nyGMhH+x6kMuVl9NdEKzyGmrcEIiQF0H6uPY6e1xy +WI7j3cv/0nUtofRNW/0/5MnBrcTERWrsNQrn0j7uOPrtUuF8OdE+KImULq9oeUGX +ZQIDAQAB +-----END PUBLIC KEY----- +` + const privateKey_Bob = `-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWacO9MIaiynnZ +pclcQ51k9vesOZuT2hr4Pt21Ip/39oGoPg+2jCXXbBlf6+KoT8qr7/MrNWzFZs4J +5ykm/l/bSbbRm1XcGG4TjRa8Kk5JXKK+de0h3tUf5rDh6erbgNlji6YR9jck3F3W +PbmYuUFzzJuW+eOz+LiMbnq6sDkgvXINYOzpM67Yj0CYc+Ni7lr54SsYc5YV8N5b +Qr85Bot4TxSrOLZYZqMZQZTyMTny/efIYyEf7HqQy5WX010QrPIaatwQiJAXQfq4 +9jp7XHJYjuPdy//SdS2h9E1b/T/kycGtxMRFauw1CufSPu44+u1S4Xw50T4oiZQu +r2h5QZdlAgMBAAECggEAUwP+x41f0btksy5gS276EL6KBeEpr9nB5t9zqER6+/Vu +rDfMnlkNja8Y9isPxwt69ZiSondzGCRcdXTC7sWYjERMBbXxFm/ZWSsWsDW9TZo2 +LF6TyYzeHiRJ3fYn7IxZ7yolN2aoGs0RcWxR4ivlJw93lEVJWoxc9w0G6cDXVuy/ +x1RVZvFLfHdBwlJhUjDMDtI1m+qlz2CBJRvlbZCkJDHAs3U8IzWRxeMt5AUQNHbq +gCJFpS0IO5CR5hazuj2l2sEho+qbO4aSYC/AB4SEm8ptBrY0TA+SBM7hQKNcOrZG +h7DHiinKMrXAtS73iHViF8vYTwjpYR+9sBVB8GMlgQKBgQDF+tihbwb6k+Wihqoz +zusl+6Yk4MdfX04v9tV16DBkaBkCmSVv1+se0UPbPDIEfM2zx6YNs5YrXdsavJU1 +OYltEmql3kenER7DUUOZ/7J3xwbiUS0E29yiAPoJl1NEf49Crawf9ukEgV9b8V2A +sOn6AiGKXaWD4c8NanekJAO8xQKBgQDCfksj3qCsRbgMAAW4PKsY+Ar+Tc8tsH8/ +YnHlqVGg7L1UTOAktCZ3dBzPtNRWwB5yKgXwsqWx2RIdrwLj1xnHxOgCzmjclK/N +8B9ka+t1d4rfrOn6/yy7wMqpPAzFRfiA+3jzYkeVgBNVup84THXNAsGZo9NIy6Zx +HE/Q61VaIQKBgQC2nA5usLsOK5aW14FsMgJBUaFIyK/87ypuIU146MaiBkZzWBDo +3Y64KSter2IvM3KEzbUDVE9CBtsPCTzTEBQLL/6AqcsLdUYbv/wLsobJ5iEaZOeS +YL1cDGyUpiieuM3KIejuvs7lYfM0Gig1iHj4KjkHqCL/xys046whETsFRQKBgEaM +QP0119olP+k6aNi3SOi5sGMmHixYhQ+cyeugSzewJ8zYRcWKgxl5SKoe0ZbWATUw +AQ+Z/XhRYLzbqpSyhWttBStfa7H3TP3KR9jJPJNTVVBlDEo7HSLNf7V7TraP9t/y +V6EQ2R5lYp4KH47wTRqcEVWFkzIojKsiteD2O/OBAoGACo1bnC4CJo9zpXVB/no1 ++TUJSAXdCBThxJ/n6ADiBJ7e4nixO7EjOzdRLkFSY/XqB7Qob6sz0oIKsLdzIYzI +HU2/x53f1H0Kps+ViCEeV7v9dlPzpw9KbG4HaPnfOJIOYlD3mmzSSd245TRrqWpY +bjluVAchFOtRbBKv7QCsz88= +-----END PRIVATE KEY----- +` + + //RsaGenKey(2048) + var doc did.Document + json.Unmarshal([]byte(did1Json), &doc) + rawData, _ := json.Marshal(doc) + //log.Println(rawData) + d := &did.Document{} + _ = json.Unmarshal(rawData, d) + log.Println(d.ID) + + //fmt.Printf("%q\n", publicKey) + //log.Println(string(privateKey)) + log.Println(publicKey) + //log.Println(privateKey) + if err != nil { + log.Println(err) + return + } + + xrsa_Alice, err := xrsa.NewXRsa(publicKey, privateKey) + if err != nil { + log.Println(err) + return + } + + xrsa_Bob, err := xrsa.NewXRsa([]byte(publicKey_Bob), []byte(privateKey_Bob)) + if err != nil { + log.Println(err) + return + } + + data := string(rawData) + encrypted, _ := xrsa_Alice.PrivateEncrypt(data) + //log.Println(encrypted) + + encrypted_Bob, _ := xrsa_Bob.PublicEncrypt(encrypted) + //log.Println(encrypted_Bob) + decrypted_Bob, _ := xrsa_Bob.PrivateDecrypt(encrypted_Bob) + + decrypted, _ := xrsa_Alice.PublicDecrypt(decrypted_Bob) + //log.Println(reflect.TypeOf(decrypted)) + de_byte := []byte(decrypted) + dd := &did.Document{} + _ = json.Unmarshal(de_byte, dd) + log.Println(dd.ID) + + sign, err := xrsa_Alice.Sign(data) + err = xrsa_Alice.Verify(data, sign) + +} diff --git a/test/XRSA_test/private.pem b/test/XRSA_test/private.pem new file mode 100644 index 0000000..157a558 --- /dev/null +++ b/test/XRSA_test/private.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQChN1txhwuCAmPO +lD/RvgDrtENCq9lO8AB8T0ry+KXA6zQCQxfVFabcaogYKt7Fz1yVbRr24bD1fAWI +Hsc19wEaEgwhr7lDmdzNs9MURKXiywuQz1M8EJIng+318QQXlPAGAWKsGpDoIx3R +TaODbjLxgW5N0Ux+JICLFF5qGUi7uXJoxtHygbdHp5xNsILo//kYz2kh5AVYc3fD +B/VhCp9qV5ZP9NxQl/k0vSjcTj2C6hLRzdkwE2SnYDa87YEZdvrDYeF01+NrQJ2I +fhPH6tItvL0gAga/EK7bWihrNehy/ZdwzyfxgbljYHjN2PZLtE11rRBUB5xZx6OH +S18/rQO3AgMBAAECggEAGE55WgeLY6GqnKXbbWshRmhaT74LOIyU9ikaWsHEc+7C +W6jz+euWydrCBCrKhbZ69giKLTjf7lMxnlFNpcRFBUI9VALjgt663MTFCWREQops +hvvLR94TuyN4CEG7ZTbObYld8CbdPDK3Nyxmf9VoluL114O77bThMJb0mTiQr8TL +yaGnVRlK2FZr/utHF1pvXzu8ZlAcXr39NhC1fqFU4JinakF0Gt+IDX2JqGiUCDez +xsuScpzG7OiX77Bx9zTlpKy0Vn50sGPqBoD1jggUIlFVjweKsY+JDOSIzAJNULjj +npEkP2iYcYlfxFLQSHeocbbZcy7KEdEJcVLF3sFumQKBgQDLQ/nbxM1QkH7+e6T9 +AJTFnoNaqI6PIc4/zUx5GvKZq8WUMzSgKpO7+XC7HFLZqthAGl1qKPgbkKXia+0L +PDw5z+ugcgvCHfG8MIrxJ4Dri4dnSq4dEqOPHXXVhAbdiAAl1RvuVQk5IDF2nkER +GsMjNU/EiBPRihT0unH81j6XkwKBgQDLCqXQq3KLNDYN5BiUoiRMEsPDLuLTYjAd +Pzx+i4G3FrJXbkMJYrqpWLBuUkESa2QiS0NSL+FkdML1+hhvPZyqRDWI4ByLc8rQ +mJDCiG6cp7b1L5b4fY1dL2gt5FTO/ctNZwjh+Z153BLCt+hnD++3aokaT5y1NsjN +Qk/VCtuxzQKBgAP1ItxAjK7Q4WgbCC9U35CpcW1GcuAejGF5oc+J0sdjLMmh5Zho +u8+hH6zE9GgAh41X9hGnEo2W12P9LfRWC+YkQjYxgkEZTCeZ2lqvpjbv1IcSUSmH +v19991lc5LVTfI1ABPcy+KcAFXZ1xlaK6tm4pADzlU8zHQ1Ww/lkQnu5AoGBAJKH +XKL7F+7d/ySHODYLzaYY5K43Z/qlIZP5zu6EP1iiSJJQQJDFb3BHUQxM0Ck610jo +h+0IIOEeYpShqICfNjCqiPf+xJrfNb7UW6QIUcs8Pg00Cv/Jm/tj+wsjfRDkl5OE +iCSMv9jxuZhMoKvAFH+JougaDD27C68V7AcTjvkBAoGAF4/BXgKT7Ws+zfotx8sn +THJRvVDPgms/M1Fi+GDJAo5ncpEn0qbDZaJVowwjxER8S8LVPrZyhwBz0NfozRjO +sdhF6v1AlbFGeZLS42b6Dt6CDRjwZROKDe2Txb4Gjce286KNFoQe29SuEROGkND0 +AD7E+TX7G3NQD12j6Be9ACc= +-----END PRIVATE KEY----- diff --git a/test/XRSA_test/public.pem b/test/XRSA_test/public.pem new file mode 100644 index 0000000..59ab63d --- /dev/null +++ b/test/XRSA_test/public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoTdbcYcLggJjzpQ/0b4A +67RDQqvZTvAAfE9K8vilwOs0AkMX1RWm3GqIGCrexc9clW0a9uGw9XwFiB7HNfcB +GhIMIa+5Q5nczbPTFESl4ssLkM9TPBCSJ4Pt9fEEF5TwBgFirBqQ6CMd0U2jg24y +8YFuTdFMfiSAixReahlIu7lyaMbR8oG3R6ecTbCC6P/5GM9pIeQFWHN3wwf1YQqf +aleWT/TcUJf5NL0o3E49guoS0c3ZMBNkp2A2vO2BGXb6w2HhdNfja0CdiH4Tx+rS +Lby9IAIGvxCu21ooazXocv2XcM8n8YG5Y2B4zdj2S7RNda0QVAecWcejh0tfP60D +twIDAQAB +-----END PUBLIC KEY----- diff --git a/test/XRSA_test/test/data.json b/test/XRSA_test/test/data.json new file mode 100644 index 0000000..aea4b58 --- /dev/null +++ b/test/XRSA_test/test/data.json @@ -0,0 +1,6 @@ +{ + "data": "新华社深圳9月13日电 国家主席习近平13日同俄罗斯总统普京分别向深圳北理莫斯科大学开学典礼致贺辞。\n  习近平在贺辞中指出,教育是国家发展进步的重要推动力,也是促进各国人民交流合作的重要纽带。近年来,中俄教育合作深入发展,两国高等院校交流更加密切,为增进两国和两国人民相互了解和友谊、推动中俄全面战略协作伙伴关系高水平发展发挥了积极作用。中俄联合创办深圳北理莫斯科大学是我和普京总统达成的重要共识,也是两国人文合作深入发展的重要成果,具有重要示范意义。\n  习近平强调,希望中俄两国教育主管部门和教育工作者发挥各自优势,深挖合作潜力,加快完善深圳北理莫斯科大学各项建设,努力建设高水平大学、培养高素质人才,为深化中俄教育合作、增进两国人民友谊作出贡献。\n  普京在贺辞中表示,教育合作一直是俄中战略伙伴关系的重要组成部分。两国高校直接交流逐年扩大,互换留学生交流实践日趋完善,两国中学生在对方国家疗养营地度假已成为常态。我相信,在两所知名大学基础上创办的俄中大学将进一步增进两国人民的友谊和相互理解。该校毕业生不仅在俄中两国、也将在世界受到欢迎。", + "encrypted": "mIO8QQXHKn0C2WZJ8f6Wt6jElaMA3bUhdUN_cEjGMYIU-UtdrtkRO8JyetVSznaWqF-xyTWT-5rnetxuVr-vTeYpyBQoM5H2rJjdNbbc9kMMlN3IUcDE3gctbagGg6McV7k0ov2Z-dnJgmJwpKgwS3vxWvY99M5IGrZkQTr7s8tzVDy3uDXOCrVvPwN-YXBy2-GsAjVEYRzsj7mv_1w3lZnGMPsAKuFWZZ4RZdQrWItgfiruWjl7R9329OG-NkBTuRcvDPa1WkdYEAE6Z2t0uM56WjhxpNxfwE4WALpcLXIbXgKquGJk9KVNoZRyLgIdhuncXQ5ih8HxTI-nuxgC9lmOCJ0VV18Zw55KR0wY1IoLyQMkARwdnaY8RpUm0kINXLqWQ9bMMnTkyLrCSfP5XIjMBCk9zREQqiN9K_OzYVzd9tr-2ItclWJ8gX7YCe9mwPK5zpB_WWc2lJi83gW0ZK0WzcqGq1KEs0wY0N0VwR6sGCIM3-HCfKxwLb0gEgg9ofkGiPoOIVxA6D_vBXuxpln_JhsyfsB25dvRqVM_dRNKuu8e0w9Lr93SUdv5MvK2xK0wkObvJ_QjmpRHvbaBUzUiP6umyzPS7h78Zr0IKT-zpoyun35nl3xu0uAkfGVl0KdDuvhDTtM1VRPEn-HbpESjCtp79C4j68nVbbejD8awC0x-wBkUy2T4duUitAUfbLApg-3RDcwYweG5a8y9BTLnvKyitzQgHG3dFZCiv6SIp7tmEvFO6Kbwp50gptQETuNFkpVb-mjjZ_pzpPcqbvTtfwBT7bauH-dLcdCXscGszLY9RKLSJg6ogrxvf2y5Rvpf-ABgf2gh2sMHCOfR-GkXQTjXbKv3cQkaXHmSLF77TJ2EpwHs5Z95UGyXI1n3WajlDrHio2W4k6kpZZ_vCiAU2ASu3sTTcl-u7N1eYAf1JA2YL-iSryVNG4V2b4EWnHwKi94qiMzKYmVmoCU15odZBxai23CUDNqzPLXmWAXNxvx8BdmWeBHlYdk58j6thTtCE78dcrgVJjEfUwhw84kXrv9rGc2eqFDkULiByHmGcRTRiDNsfyB6XLI8Gve7qssZ9jwxcvx8uXX-9qQ7A75iyuFGBckdQoQwCmda6spAnLEWfr-VSqNotJuqmeo_X3l1vFsZ2nBWtDbA3iDVi6ZWWSj2vlqrxXu6-726wtgf4ZTXCzuIrAt1nohIE7lM0oSuocgLQDBdeasrvstZCvjgr6LEeNPsyKbfbSrcBlKDh6KAt_uemd66cN54fCqxIWsYnD-U0RKairO8Rc0PGEb3DbZqNVVfXfDsK5ZDMnb4QR-ElYf1tgFLmA-zwq6mOmy6hWUmN21bybHvZ2hki8FnKxBuQVKMAyG4o0K2cC0dI_bPoXKca7wh8Ps5mKDerUmRnpaGucdc0X3XMTIQ99LM3pFgkufSeftcoSxHKZ3YGDjC4fPhiPaioi6rDk_lcFLDLd8hgcKde2gqzQkPA-LIteNmX2mzFMtCMWgiQHCyXFl1qOX6k0iKpcLeIFUOBGCo767gmuyg2jpcAZYQ6y8diCnNod2vERpfnziuV_kQXFuYC0GMyGl0yGwsx82j7cUyWgV6MeQ-a3LlIhjluVw3zT7RcItJczIQxsnb0-gFR-SG6Ir6k-g763gZRtKcNVDGsYAmXeOA0IH1Gt_m_rNlOuOgTi7LclJQ0p4geYajLRO4S7xb0l6xM9GsFCuc_VrTZilcDyxV7rN1dw-pBkdD4e6s-wMXBSjHkE55xKEPNkInXC9JVP4za4ed2VauAsHeLPwVzxXrvIb0Wf06zABwhM7i00k2DLqEqpijCPkiYP1QTieEu67zOfzwmjiODTSfOSlaVEXSAyAToOyauYGFJsiW3JLLWqg494oXRnKXKyKrhj5UdXtDDPLkVbZJ8jtLqRKTCMWC4asTH1hAMCIzKVrqfCRrazH5RmNm4qR0CHxhtwpkrmtznTvScECMFdDqIno2H7UU6MtZ_CueNoJbG9iKgAleDGNH-L0wE6ZP7YiS2uI6Hrybghb3vIpV", + "private_encrypted": "gdr-d2fng_DNtLyRlRkdszVTLlTgqg8uSkwfPlV28KBTgONG-fr2OrptCpCQsi1UGw_9KX3Ll5Uy6ies0L84mcEpxK9Tz3RK-MZw5fYKP74WujzdGxFGZy4HPibG2EIYrczbITj9xcmjco_w86GizkawWDffH5ABCG9lkHvlRvs1XcEjPjQeQD3aEEeIyWBR6DW1ERg8OFcbHeX67yTL_LyMi_frmf8FrWXib72BqZGaCopTDeuzzCcgDdxJ22qZAysqjLpQU6KE0GfZexkKAzJTt5P29piwWX10g1Sfdlz9WNIB6BBiUOjmd2_3zlj9zTMi3CWmEXEl6J5XaMYVFXnwfOrBBKPXcQdZQCq9p5ZF2Gqlw4YrEagaCGsOx-WlBHMQUP9FGZRsNHu8yRDiL_VLa-OonSdVb1sAUBHqmqs51nPoMbGo0RNSfPc14utSxcdZwe0EmtFfDnTSAD8OhOPod6Q8qSTB21yvG52Qc_m26TQGEqnEdVWd5N2Zyv42Vhm0WDVQjOZxKe9hSGXe1VZhxWLzCkZIX5bm1QkAWHqaL-2pWzaNzLAe8-BHCSIaXD2dohs7XgPAfDtKfr0fF-voWPjjrk6hEoztzDNf6RvJTh0d8NmqnEyAdJMAexN5ZU09AX4M8A16c9DSnGF_Ui1Boq4uzElq7WGxW9Ze2jIegWKBSgh6DHTPVUN2X7bmK9aY_fpoYBtZd9nIp6VacOuRsgFqrjutVAzOYAg7cjHaWb3EKE2wzPJUTgyfYNRQtTtJJZP7uIqjkGmlQ8A5lsGtuybJJ3VEGn2XMsXmqC-sfsDMNR4oYvxcnrJmPZPVYqYubxhUUlci7ggregj7tKqGr_BswCEm4JJ0pYY3631FP9XetBeZNMz3N9p-8Xce6sEoKO5v_s8jMZLMv4FU7yf7lz9A5ENk-jSJnyRnIoggeCOWq-qwru292KieqUmcvZAF777JTFthR1vOnmWuyAg-vpiOnzRAtCJIRCoILVQMJHf_el5DnUcpnXaunw8Vq6tT2Bckhyw9kJXir77S4OcJAHh3rl__340Rv0B5Fkw4KKIwRTLfGY06KV-38gTe9_Y9sx4aJFfHgnrc5GjM9nLZLfEqmTecYTOilTf9xKV-BRB3d2I3jvUV1zNsFLqjbKOujUKac9-JDfJOIeoTOkw7sqasEUxetYDDK-Bt2niNKyxjQmrzpWR2I3PQzblCd6ClMqVKPuPe01h4LeGjPanv-WA7dCUzTxJZm11EJQtrncadP26HIWr8e7KcVmGPQneK7Yijl1jybT1il6pHrwYYWjFKVH5aPGJYCJLPqK83GP0idAn1gQl3NCwTw3-63p9CpD68PH1R435A-_CqU0-8UPhdrswVCwC19odPsYdgzPmbfJGVuiFUa-0qkPF2XjwWIzb4KInZqYDEPAACIcOxIlFRkGdUYwwhKzOv99tb6o8a_zqteWQwOdCpdXrk6T2bO0ocRwSxT4cCZeahY9bIwZThj6fqCP1zhL2Bgp3KxqwEmkhlxxy2CmipvouUeZhFc10ZurEkyunKe6InlyLf5B6kkzeM8FurYYjDrKSIIBs2YOvl9CRPEtdo2TPCZh2sWJQl6-i27npNa_VyzZIUcYbRMDHOB4-fI3O1WT1YrR9KzYY8CSvfAJmB4PQ0KLGwZf4TxIZXPYVejvzyYNfsaLDEiVXUsbFnPOcA5-8OzHCLmywAXC_Fi59ffW7u1GoEYwJTjur24pSFIqohUuv09vqWfePWhtYxD7YLMUqLnd8rknfAxGIY4Flpd3cxQvUfy2FHp7pVY_DOVL7CgZugiNEIqiT1LOUM3I3cDzoJuIUs4Gz_vQvrI2w7Kn_0dwhJPxyiLOBxdntWEute493iuKu6zl5KZ6u08nYlWRD9VWrnA2VlBDXsj0zsPm2JlUDqUQs0G5N1sOvjP4-5nunfAnqbcCt7deFgVQNv8wJqhPQXhYWC9A6Ah8sTZPv8J0qB08U3fBuIUMFFsDZQlePFwPJn7vxT4WHeQaae5QCjLKuO4ezMEgWcPGkDFuSu", + "sign": "YNPQBKnviatPpB5OL0G3jDHNyM7AoeyXNTyNykrwonubDbGG5fcmnyZAfeD_btdWgz7_zkGQ2I6H5u5nkhMPB9InTwrnfxSGzWOa0Q2O4qfSPpLbuwcyED-TxM-yFncEqtlKY11mefxI5nYWHUp7iIQh_Nj1orbCmvnHHt1QERebv0jAYWQYarVRdsnYP-nV-ZPZw2ybM1I2vQTWxDCkkFSr-HhlwAMlT6OHW7uksU7fNxQyfn_UZf3Gv3XSGC3ubjM-CJLAp9MDC87aa7NgyDv1mmP_m3yr1eXDltFebaZxXxk99NtvMbWdrty7k3tBr_EfCnlHvl05bxy_hLRKcQ" +} \ No newline at end of file diff --git a/test/XRSA_test/test/did1-expected.json b/test/XRSA_test/test/did1-expected.json new file mode 100644 index 0000000..06fc173 --- /dev/null +++ b/test/XRSA_test/test/did1-expected.json @@ -0,0 +1,57 @@ +{ + "@context": "https://www.w3.org/ns/did/v1", + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "controller": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "did:nuts:f03a00f1-9615-4060-bd00-bd282e150c46" + ], + "verificationMethod": [ + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-1", + "type": "JsonWebKey2020", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyJwk": { + "kty": "EC", + "crv": "P-256", + "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + } + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-2", + "type": "JsonWebKey2020", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyJwk": { + "kty": "EC", + "crv": "P-256", + "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + } + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#added-assertion-method-1", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyBase58": "GGRj8PAR5tRgD5xqAhPna1bLa3UoYuxNEEhRmcYCPBm5", + "type": "Ed25519VerificationKey2018" + } + ], + "authentication": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-1", + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-2" + ], + "assertionMethod": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-1" + ], + "service": [ + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-1", + "type": "nuts:bolt:eoverdracht", + "serviceEndpoint": "did:nuts:#service-76" + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-2", + "type": "nuts:core:consent", + "serviceEndpoint": "did:nuts:#service-2" + } + ] +} \ No newline at end of file diff --git a/test/XRSA_test/test/did1.json b/test/XRSA_test/test/did1.json new file mode 100644 index 0000000..6e70e85 --- /dev/null +++ b/test/XRSA_test/test/did1.json @@ -0,0 +1,59 @@ +{ + "@context": [ + "https://www.w3.org/ns/did/v1" + ], + "id": "did:nuts:04cf1e20378a4e38ab1b401a5018c9ff", + "controller": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "did:nuts:f03a00f1-9615-4060-bd00-bd282e150c46" + ], + "verificationMethod": [ + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "type": "JsonWebKey2020", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyJwk": { + "kty": "EC", + "crv": "P-256", + "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + } + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#key-2", + "type": "JsonWebKey2020", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyJwk": { + "kty": "EC", + "crv": "P-256", + "x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74", + "y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI" + } + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#added-assertion-method-1", + "controller": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "publicKeyBase58": "GGRj8PAR5tRgD5xqAhPna1bLa3UoYuxNEEhRmcYCPBm5", + "type": "Ed25519VerificationKey2018" + } + ], + "authentication": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff", + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff" + ], + "assertionMethod": [ + "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff" + ], + "service": [ + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-1", + "type": "nuts:bolt:eoverdracht", + "serviceEndpoint": "did:nuts:#service-76" + }, + { + "id": "did:nuts:04cf1e20-378a-4e38-ab1b-401a5018c9ff#service-2", + "type": "nuts:core:consent", + "serviceEndpoint": "did:nuts:123456" + } + ] +} \ No newline at end of file diff --git a/test/XRSA_test/test/pri.base64cert b/test/XRSA_test/test/pri.base64cert new file mode 100644 index 0000000..55943a7 --- /dev/null +++ b/test/XRSA_test/test/pri.base64cert @@ -0,0 +1 @@ +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDGkCUBYFYV8aazeF4sux9uCSL8sx6HoixAeBeL9Qr2tQfpqqkKUo_ElnDjEzfYoPyMwYO7fyMw8GdktbCe-IKw1r0XtcKTgpYY9Yyi9yasnrvWwF0crJFEICjE7E_qOXugOUe2DUXFBMR0qj9JZ4ZyIDIwOKpbulq7dhHjQc1l02-bJ4XuLhD-FcgJSPL3ghouzzQmsx7HPe_-KoNpYIxXoKrLGffsuEMLYpKf46RRf8yHDvWrv1jhhtcZOVJyOgSzVvP1hGkq40qlAkJOpP-kTahB0togEqukR4ftvTWyPhk-bKDYVcbOaEIebgAkgDlGloWAOvXvBMfkKXe_f_xjAgMBAAECggEBAKIizbTD_0dH3UErBmssGMv29fS2JjXGfK_f4ApOezdcNyvcSM--_todpewlozJmshIVagXOGOQ7SZH4slH8xmqzzg_wQQPGW93hk4b2nUPTEbqXtPBXEP8561BxTggKDCKW4zGKwO_RpsFEywybVjMWiyTJAIKKNtBf5tdUwe1kOX86o7MCL9E3sRXtBUAN1sXnTCqA9syin1ggIOpwRsp0Vbc-Ao9TI465Ca3YWG_lC4wrs7zRhLvHZBEH__N0HivGTJovU_tGDX31Tdws6gytKd3grMvyhNQo-_wbNCH2yk2K3nhOi99ap16ALSY6CI8-A9z1sptoIY8B2fz7VPECgYEA9RewN9x-9kFZSkDicidFl1pK2_4BXSHH2SdKhDaupN7oyrzaS68_HZ7BV3VsSqD1EZxKlJetU-D_i5Yj877tDnLqEWyvWuS61n8eEjl-dixnx2usZ9CaY0fX1CxVPwaoiy14UqXNwuPLo5poqCAgjdGsn7nXVUhECeiq9wlBhoUCgYEAz2ZZ6Kxm7C8oTptbDgG73vBFr5arHDvz4kzWGVfyB6TUO5TMjngOmOfi31dsmFPVnktptSV1UGrLjQdksx4rl4roIf53Uj-4B-Z2yIaIR0WsAFZuCZ5vN-uzy0R1D3kyZSnGz78aYSJK6wgh4ERnZ_rd4ovHvD0wraUj0P_GL8cCgYEAu49iOo2R15AQ7cMTx_oHxpjBmvMaRhQ45RStcNqL8f3oNmYpxCubaGZ6XRyuP7pHcS-i323npb4UsdS3NKwSq7EDMUx0MWHDHazv7VB0V6kJzlG3AUdhLsLnBybaIb5Nsxyb7NuXyCIdT9k1aBwV7ZHcwestP8Vq1A5q71v0-iUCgYBkZPsosiuwMLOmOXW-NgCnTk-tS5XQuQS5itAovHWgVZ2WqdTLMjp-seEUk9Exe4NweLjWwyciok-eGPIZ8oTPeqIbsn44BjgjOuBM-TKGracxEqV5aoQT4bjKsHyp3NUUO0DN14gBdQQm-WzMjtAveTRnMZqh-EzUAZhw1x8siQKBgCTFy1RgC5kJ5fb4Ahk9LyuLW_Tsvf-kuNcA2xstO5garXiV96PA--D0jATWkJzA5w8pm86tVlVTYxgcZp8B1whlqMh9jhkV9LxR62k17bMhKGx8KDR4dseo6016N8SruzVu6lWpelkorHAbiIi8pdexMIQ2prZNWE_k9uyHI8Ng \ No newline at end of file diff --git a/test/XRSA_test/test/pri.pem b/test/XRSA_test/test/pri.pem new file mode 100644 index 0000000..9844513 --- /dev/null +++ b/test/XRSA_test/test/pri.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDGkCUBYFYV8aaz +eF4sux9uCSL8sx6HoixAeBeL9Qr2tQfpqqkKUo/ElnDjEzfYoPyMwYO7fyMw8Gdk +tbCe+IKw1r0XtcKTgpYY9Yyi9yasnrvWwF0crJFEICjE7E/qOXugOUe2DUXFBMR0 +qj9JZ4ZyIDIwOKpbulq7dhHjQc1l02+bJ4XuLhD+FcgJSPL3ghouzzQmsx7HPe/+ +KoNpYIxXoKrLGffsuEMLYpKf46RRf8yHDvWrv1jhhtcZOVJyOgSzVvP1hGkq40ql +AkJOpP+kTahB0togEqukR4ftvTWyPhk+bKDYVcbOaEIebgAkgDlGloWAOvXvBMfk +KXe/f/xjAgMBAAECggEBAKIizbTD/0dH3UErBmssGMv29fS2JjXGfK/f4ApOezdc +NyvcSM++/todpewlozJmshIVagXOGOQ7SZH4slH8xmqzzg/wQQPGW93hk4b2nUPT +EbqXtPBXEP8561BxTggKDCKW4zGKwO/RpsFEywybVjMWiyTJAIKKNtBf5tdUwe1k +OX86o7MCL9E3sRXtBUAN1sXnTCqA9syin1ggIOpwRsp0Vbc+Ao9TI465Ca3YWG/l +C4wrs7zRhLvHZBEH//N0HivGTJovU/tGDX31Tdws6gytKd3grMvyhNQo+/wbNCH2 +yk2K3nhOi99ap16ALSY6CI8+A9z1sptoIY8B2fz7VPECgYEA9RewN9x+9kFZSkDi +cidFl1pK2/4BXSHH2SdKhDaupN7oyrzaS68/HZ7BV3VsSqD1EZxKlJetU+D/i5Yj +877tDnLqEWyvWuS61n8eEjl+dixnx2usZ9CaY0fX1CxVPwaoiy14UqXNwuPLo5po +qCAgjdGsn7nXVUhECeiq9wlBhoUCgYEAz2ZZ6Kxm7C8oTptbDgG73vBFr5arHDvz +4kzWGVfyB6TUO5TMjngOmOfi31dsmFPVnktptSV1UGrLjQdksx4rl4roIf53Uj+4 +B+Z2yIaIR0WsAFZuCZ5vN+uzy0R1D3kyZSnGz78aYSJK6wgh4ERnZ/rd4ovHvD0w +raUj0P/GL8cCgYEAu49iOo2R15AQ7cMTx/oHxpjBmvMaRhQ45RStcNqL8f3oNmYp +xCubaGZ6XRyuP7pHcS+i323npb4UsdS3NKwSq7EDMUx0MWHDHazv7VB0V6kJzlG3 +AUdhLsLnBybaIb5Nsxyb7NuXyCIdT9k1aBwV7ZHcwestP8Vq1A5q71v0+iUCgYBk +ZPsosiuwMLOmOXW+NgCnTk+tS5XQuQS5itAovHWgVZ2WqdTLMjp+seEUk9Exe4Nw +eLjWwyciok+eGPIZ8oTPeqIbsn44BjgjOuBM+TKGracxEqV5aoQT4bjKsHyp3NUU +O0DN14gBdQQm+WzMjtAveTRnMZqh+EzUAZhw1x8siQKBgCTFy1RgC5kJ5fb4Ahk9 +LyuLW/Tsvf+kuNcA2xstO5garXiV96PA++D0jATWkJzA5w8pm86tVlVTYxgcZp8B +1whlqMh9jhkV9LxR62k17bMhKGx8KDR4dseo6016N8SruzVu6lWpelkorHAbiIi8 +pdexMIQ2prZNWE/k9uyHI8Ng +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/test/XRSA_test/test/pub.base64cert b/test/XRSA_test/test/pub.base64cert new file mode 100644 index 0000000..ce9792a --- /dev/null +++ b/test/XRSA_test/test/pub.base64cert @@ -0,0 +1 @@ +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxpAlAWBWFfGms3heLLsfbgki_LMeh6IsQHgXi_UK9rUH6aqpClKPxJZw4xM32KD8jMGDu38jMPBnZLWwnviCsNa9F7XCk4KWGPWMovcmrJ671sBdHKyRRCAoxOxP6jl7oDlHtg1FxQTEdKo_SWeGciAyMDiqW7pau3YR40HNZdNvmyeF7i4Q_hXICUjy94IaLs80JrMexz3v_iqDaWCMV6Cqyxn37LhDC2KSn-OkUX_Mhw71q79Y4YbXGTlScjoEs1bz9YRpKuNKpQJCTqT_pE2oQdLaIBKrpEeH7b01sj4ZPmyg2FXGzmhCHm4AJIA5RpaFgDr17wTH5Cl3v3_8YwIDAQAB \ No newline at end of file diff --git a/test/XRSA_test/test/pub.pem b/test/XRSA_test/test/pub.pem new file mode 100644 index 0000000..c9bb0e1 --- /dev/null +++ b/test/XRSA_test/test/pub.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxpAlAWBWFfGms3heLLsf +bgki/LMeh6IsQHgXi/UK9rUH6aqpClKPxJZw4xM32KD8jMGDu38jMPBnZLWwnviC +sNa9F7XCk4KWGPWMovcmrJ671sBdHKyRRCAoxOxP6jl7oDlHtg1FxQTEdKo/SWeG +ciAyMDiqW7pau3YR40HNZdNvmyeF7i4Q/hXICUjy94IaLs80JrMexz3v/iqDaWCM +V6Cqyxn37LhDC2KSn+OkUX/Mhw71q79Y4YbXGTlScjoEs1bz9YRpKuNKpQJCTqT/ +pE2oQdLaIBKrpEeH7b01sj4ZPmyg2FXGzmhCHm4AJIA5RpaFgDr17wTH5Cl3v3/8 +YwIDAQAB +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/test/XRSA_test/test/util.go b/test/XRSA_test/test/util.go new file mode 100644 index 0000000..20b773c --- /dev/null +++ b/test/XRSA_test/test/util.go @@ -0,0 +1,13 @@ +package test + +import ( + "io/ioutil" +) + +func ReadTestFile(name string) []byte { + data, err := ioutil.ReadFile(name) + if err != nil { + panic(err) + } + return data +} diff --git a/vendor/xrsa/go.mod b/vendor/xrsa/go.mod new file mode 100644 index 0000000..d817090 --- /dev/null +++ b/vendor/xrsa/go.mod @@ -0,0 +1,5 @@ +module x-rsa/golang/xrsa + +go 1.16 + +require github.com/bytehubplus/fusion v0.0.0-20221009025951-14a13ff7d6bc diff --git a/vendor/xrsa/go.sum b/vendor/xrsa/go.sum new file mode 100644 index 0000000..95944fd --- /dev/null +++ b/vendor/xrsa/go.sum @@ -0,0 +1,640 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= +github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= +github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= +github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= +github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/bytehubplus/fusion v0.0.0-20221009025951-14a13ff7d6bc h1:FuYuAs8IfihLTazlFV2ds+BTuTsPLAk8papHRBq+SX4= +github.com/bytehubplus/fusion v0.0.0-20221009025951-14a13ff7d6bc/go.mod h1:PYEEXbPC6ZtKLboi9BdF+ULwD84w6z9CR4MMFgteYUQ= +github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= +github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= +github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= +github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= +github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= +github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= +github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ethereum/go-ethereum v1.10.25/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= +github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= +github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/goccy/go-json v0.9.4/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= +github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= +github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= +github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= +github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= +github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= +github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= +github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= +github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= +github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= +github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= +github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= +github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= +github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= +github.com/lestrrat-go/blackmagic v1.0.0 h1:XzdxDbuQTz0RZZEmdU7cnQxUtFUzgCSPq8RCz4BxIi4= +github.com/lestrrat-go/blackmagic v1.0.0/go.mod h1:TNgH//0vYSs8VXDCfkZLgIrVTTXQELZffUV0tz3MtdQ= +github.com/lestrrat-go/httpcc v1.0.0 h1:FszVC6cKfDvBKcJv646+lkh4GydQg2Z29scgUfkOpYc= +github.com/lestrrat-go/httpcc v1.0.0/go.mod h1:tGS/u00Vh5N6FHNkExqGGNId8e0Big+++0Gf8MBnAvE= +github.com/lestrrat-go/iter v1.0.1 h1:q8faalr2dY6o8bV45uwrxq12bRa1ezKrB6oM9FUgN4A= +github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc= +github.com/lestrrat-go/jwx v1.2.18 h1:RV4hcTRUlPVYUnGqATKXEojoOsLexoU8Na4KheVzxQ8= +github.com/lestrrat-go/jwx v1.2.18/go.mod h1:bWTBO7IHHVMtNunM8so9MT8wD+euEY1PzGEyCnuI2qM= +github.com/lestrrat-go/option v1.0.0 h1:WqAWL8kh8VcSoD6xjSH34/1m8yxluXQbDeKNfvFeEO4= +github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= +github.com/nuts-foundation/go-did v0.3.0 h1:uZoFnwiAlJgVWWsr8b7tJXSMUgW2bajaLANE0f43fu4= +github.com/nuts-foundation/go-did v0.3.0/go.mod h1:MD2sE53BOvsQHZ9CmGI+EGXPUk1QiU9bUqB062y9+N8= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/ockam-network/did v0.1.4-0.20210103172416-02ae01ce06d8 h1:s5GFggECXv/KwF37ax4B7ACMOKoUnKvmur4i+7I07UE= +github.com/ockam-network/did v0.1.4-0.20210103172416-02ae01ce06d8/go.mod h1:ZsbTIuVGt8OrQEbqWrSztUISN4joeMabdsinbLubbzw= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= +github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= +github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shengdoushi/base58 v1.0.0 h1:tGe4o6TmdXFJWoI31VoSWvuaKxf0Px3gqa3sUWhAxBs= +github.com/shengdoushi/base58 v1.0.0/go.mod h1:m5uIILfzcKMw6238iWAhP4l3s5+uXyF3+bJKUNhAL9I= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= +github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= +github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220924013350-4ba4fb4dd9e7 h1:WJywXQVIb56P2kAvXeMGTIgQ1ZHQxR60+F9dLsodECc= +golang.org/x/crypto v0.0.0-20220924013350-4ba4fb4dd9e7/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220923203811-8be639271d50/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= +gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/vendor/xrsa/rsa.go b/vendor/xrsa/rsa.go new file mode 100644 index 0000000..64f0118 --- /dev/null +++ b/vendor/xrsa/rsa.go @@ -0,0 +1,115 @@ +package xrsa + +import ( + "crypto/rsa" + "crypto" + "errors" + "fmt" + "math/big" +) + +// see https://github.com/buf1024/golib/blob/master/crypt/rsa.go + +// copy from crypt/rsa/pkcs1v15.go +var hashPrefixes = map[crypto.Hash][]byte{ + crypto.MD5: {0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10}, + crypto.SHA1: {0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14}, + crypto.SHA224: {0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c}, + crypto.SHA256: {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20}, + crypto.SHA384: {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30}, + crypto.SHA512: {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40}, + crypto.MD5SHA1: {}, // A special TLS case which doesn't use an ASN1 prefix. + crypto.RIPEMD160: {0x30, 0x20, 0x30, 0x08, 0x06, 0x06, 0x28, 0xcf, 0x06, 0x03, 0x00, 0x31, 0x04, 0x14}, +} + +// copy from crypt/rsa/pkcs1v15.go +func encrypt(c *big.Int, pub *rsa.PublicKey, m *big.Int) *big.Int { + e := big.NewInt(int64(pub.E)) + c.Exp(m, e, pub.N) + return c +} + +// copy from crypt/rsa/pkcs1v15.go +func pkcs1v15HashInfo(hash crypto.Hash, inLen int) (hashLen int, prefix []byte, err error) { + // Special case: crypto.Hash(0) is used to indicate that the data is + // signed directly. + if hash == 0 { + return inLen, nil, nil + } + + hashLen = hash.Size() + if inLen != hashLen { + return 0, nil, errors.New("crypto/rsa: input must be hashed message") + } + prefix, ok := hashPrefixes[hash] + if !ok { + return 0, nil, errors.New("crypto/rsa: unsupported hash function") + } + return +} + +// copy from crypt/rsa/pkcs1v15.go +func leftPad(input []byte, size int) (out []byte) { + n := len(input) + if n > size { + n = size + } + out = make([]byte, size) + copy(out[len(out)-n:], input) + return +} +func unLeftPad(input []byte) (out []byte) { + n := len(input) + t := 2 + for i := 2; i < n; i++ { + if input[i] == 0xff { + t = t + 1 + } else { + if input[i] == input[0] { + t = t + int(input[1]) + } + break + } + } + out = make([]byte, n-t) + copy(out, input[t:]) + return +} + +func PrivateEncrypt(privt *rsa.PrivateKey, data []byte) ([]byte, error) { + signData, err := rsa.SignPKCS1v15(nil, privt, crypto.Hash(0), data) + if err != nil { + return nil, err + } + return signData, nil +} +func PublicDecrypt(pub *rsa.PublicKey, data []byte) ([]byte, error) { + decData, err := publicDecrypt(pub, crypto.Hash(0), nil, data) + + + if err != nil { + return nil, err + } + return decData, nil +} + +func publicDecrypt(pub *rsa.PublicKey, hash crypto.Hash, hashed []byte, sig []byte) (out []byte, err error) { + hashLen, prefix, err := pkcs1v15HashInfo(hash, len(hashed)) + if err != nil { + return nil, err + } + + tLen := len(prefix) + hashLen + k := (pub.N.BitLen() + 7) / 8 + if k < tLen+11 { + return nil, fmt.Errorf("length illegal") + } + + c := new(big.Int).SetBytes(sig) + m := encrypt(new(big.Int), pub, c) + em := leftPad(m.Bytes(), k) + out = unLeftPad(em) + + err = nil + return +} \ No newline at end of file diff --git a/vendor/xrsa/xrsa.go b/vendor/xrsa/xrsa.go new file mode 100644 index 0000000..f73a9ac --- /dev/null +++ b/vendor/xrsa/xrsa.go @@ -0,0 +1,226 @@ +package xrsa + +import ( + "bytes" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/base64" + "encoding/pem" + "errors" + "io" + "os" +) + +const ( + CHAR_SET = "UTF-8" + BASE_64_FORMAT = "UrlSafeNoPadding" + RSA_ALGORITHM_KEY_TYPE = "PKCS8" + RSA_ALGORITHM_SIGN = crypto.SHA256 +) + +type XRsa struct { + publicKey *rsa.PublicKey + privateKey *rsa.PrivateKey +} + +func CreateKeys(publicKeyWriter, privateKeyWriter io.Writer, keyLength int) error { + // 生成私钥文件 + privateKey, err := rsa.GenerateKey(rand.Reader, keyLength) + if err != nil { + return err + } + derStream, err := x509.MarshalPKCS8PrivateKey(privateKey) + if err != nil { + return err + } + block := &pem.Block{ + Type: "PRIVATE KEY", + Bytes: derStream, + } + priveFile, err := os.Create("private.pem") + defer priveFile.Close() + if err != nil { + return err + } + err = pem.Encode(priveFile, block) + if err != nil { + return err + } + err = pem.Encode(privateKeyWriter, block) + if err != nil { + return err + } + + // 生成公钥文件 + publicKey := &privateKey.PublicKey + derPkix, err := x509.MarshalPKIXPublicKey(publicKey) + if err != nil { + return err + } + block = &pem.Block{ + Type: "PUBLIC KEY", + Bytes: derPkix, + } + pubFile, err := os.Create("public.pem") + defer pubFile.Close() + if err != nil { + return err + } + + //将公钥块编码到文件 + err = pem.Encode(pubFile, block) + if err != nil { + return err + } + err = pem.Encode(publicKeyWriter, block) + if err != nil { + return err + } + + return nil +} + +func NewXRsa(publicKey []byte, privateKey []byte) (*XRsa, error) { + block, _ := pem.Decode(publicKey) + if block == nil { + return nil, errors.New("public key error") + } + pubInterface, err := x509.ParsePKIXPublicKey(block.Bytes) + if err != nil { + return nil, err + } + pub := pubInterface.(*rsa.PublicKey) + + if privateKey == nil { + return &XRsa{ + publicKey: pub, + privateKey: nil, + }, nil + } + block, _ = pem.Decode(privateKey) + if block == nil { + return nil, errors.New("private key error") + } + priv, err := x509.ParsePKCS8PrivateKey(block.Bytes) + if err != nil { + return nil, err + } + + pri, ok := priv.(*rsa.PrivateKey) + if ok { + return &XRsa{ + publicKey: pub, + privateKey: pri, + }, nil + } else { + return nil, errors.New("private key not supported") + } +} + +func (r *XRsa) PublicEncrypt(data string) (string, error) { + partLen := r.publicKey.N.BitLen()/8 - 11 + chunks := split([]byte(data), partLen) + + buffer := bytes.NewBufferString("") + for _, chunk := range chunks { + bts, err := rsa.EncryptPKCS1v15(rand.Reader, r.publicKey, chunk) + if err != nil { + return "", err + } + buffer.Write(bts) + } + + return base64.RawURLEncoding.EncodeToString(buffer.Bytes()), nil +} + +func (r *XRsa) PrivateDecrypt(encrypted string) (string, error) { + partLen := r.publicKey.N.BitLen() / 8 + raw, err := base64.RawURLEncoding.DecodeString(encrypted) + chunks := split([]byte(raw), partLen) + + buffer := bytes.NewBufferString("") + for _, chunk := range chunks { + decrypted, err := rsa.DecryptPKCS1v15(rand.Reader, r.privateKey, chunk) + if err != nil { + return "", err + } + buffer.Write(decrypted) + } + + return buffer.String(), err +} + +func (r *XRsa) PrivateEncrypt(data string) (string, error) { + partLen := r.publicKey.N.BitLen()/8 - 11 + chunks := split([]byte(data), partLen) + + buffer := bytes.NewBufferString("") + for _, chunk := range chunks { + bts, err := PrivateEncrypt(r.privateKey, chunk) + if err != nil { + return "", err + } + + buffer.Write(bts) + } + + return base64.RawURLEncoding.EncodeToString(buffer.Bytes()), nil +} + +func (r *XRsa) PublicDecrypt(encrypted string) (string, error) { + partLen := r.publicKey.N.BitLen() / 8 + raw, err := base64.RawURLEncoding.DecodeString(encrypted) + chunks := split([]byte(raw), partLen) + + buffer := bytes.NewBufferString("") + for _, chunk := range chunks { + decrypted, err := PublicDecrypt(r.publicKey, chunk) + + if err != nil { + return "", err + } + buffer.Write(decrypted) + } + + return buffer.String(), err +} + +func (r *XRsa) Sign(data string) (string, error) { + h := RSA_ALGORITHM_SIGN.New() + h.Write([]byte(data)) + hashed := h.Sum(nil) + + sign, err := rsa.SignPKCS1v15(rand.Reader, r.privateKey, RSA_ALGORITHM_SIGN, hashed) + if err != nil { + return "", err + } + return base64.RawURLEncoding.EncodeToString(sign), err +} + +func (r *XRsa) Verify(data string, sign string) error { + h := RSA_ALGORITHM_SIGN.New() + h.Write([]byte(data)) + hashed := h.Sum(nil) + + decodedSign, err := base64.RawURLEncoding.DecodeString(sign) + if err != nil { + return err + } + + return rsa.VerifyPKCS1v15(r.publicKey, RSA_ALGORITHM_SIGN, hashed, decodedSign) +} + +func split(buf []byte, lim int) [][]byte { + var chunk []byte + chunks := make([][]byte, 0, len(buf)/lim+1) + for len(buf) >= lim { + chunk, buf = buf[:lim], buf[lim:] + chunks = append(chunks, chunk) + } + if len(buf) > 0 { + chunks = append(chunks, buf[:]) + } + return chunks +} diff --git a/vendor/xrsa/xrsa_test.go b/vendor/xrsa/xrsa_test.go new file mode 100644 index 0000000..01cc787 --- /dev/null +++ b/vendor/xrsa/xrsa_test.go @@ -0,0 +1,121 @@ +package xrsa + +import( + "testing" + "bytes" + "fmt" + "io/ioutil" + "encoding/json" +) + +var publicKey *bytes.Buffer = bytes.NewBufferString("") +var privateKey *bytes.Buffer = bytes.NewBufferString("") +var xrsa *XRsa + +func TestCreateKeys(t *testing.T) { + err := CreateKeys(publicKey, privateKey, 2048) + if err != nil { + t.Error(err.Error()) + } +} + +func TestNewXRsa(t *testing.T) { + var err error + xrsa, err = NewXRsa(publicKey.Bytes(), privateKey.Bytes()) + if err != nil { + t.Error(err.Error()) + } +} + +func TestPublicEncryptDecrypt(t *testing.T) { + data := "Estimates of the number of languages中国 in the world vary between 5,000 and 7,000. However, any precise estimate depends on a partly arbitrary distinction between languages and dialects. Natural languages are spoken or signed, but any language can be encoded into secondary media using auditory, visual, or tactile stimuli – for example, in whistling, signed, or braille. This is because human language is modality-independent. Depending on philosophical perspectives regarding the definition of language and meaning, when used as a general concept, language may refer to the cognitive ability to learn and use systems of complex communication, or to describe the set of rules that makes up these systems, or the set of utterances that can be produced from those rules. All languages rely on the process of semiosis to relate signs to particular meanings. Oral, manual and tactile languages contain a phonological system that governs how symbols are used to form sequences known as words or morphemes, and a syntactic system that governs how words and morphemes are combined to form phrases and utterances." + encrypted, err := xrsa.PublicEncrypt(data) + if err != nil { + t.Fatal(err.Error()) + } + + decrypted, err := xrsa.PrivateDecrypt(encrypted) + if err != nil { + t.Fatal(err.Error()) + } + + if string(decrypted) != data { + t.Fatal(fmt.Sprintf("Faild assert \"%s\" equals \"%s\"", decrypted, data)) + } +} + +func TestPrivateEncryptDecrypt(t *testing.T) { + data := "Estimates of the number of languages中国 in the world vary between 5,000 and 7,000. However, any precise estimate depends on a partly arbitrary distinction between languages and dialects. Natural languages are spoken or signed, but any language can be encoded into secondary media using auditory, visual, or tactile stimuli – for example, in whistling, signed, or braille. This is because human language is modality-independent. Depending on philosophical perspectives regarding the definition of language and meaning, when used as a general concept, language may refer to the cognitive ability to learn and use systems of complex communication, or to describe the set of rules that makes up these systems, or the set of utterances that can be produced from those rules. All languages rely on the process of semiosis to relate signs to particular meanings. Oral, manual and tactile languages contain a phonological system that governs how symbols are used to form sequences known as words or morphemes, and a syntactic system that governs how words and morphemes are combined to form phrases and utterances." + encrypted, err := xrsa.PrivateEncrypt(data) + if err != nil { + t.Fatal(err.Error()) + } + + decrypted, err := xrsa.PublicDecrypt(encrypted) + if err != nil { + t.Fatal(err.Error()) + } + + if string(decrypted) != data { + t.Fatal(fmt.Sprintf("Faild assert \"%s\" equals \"%s\"", decrypted, data)) + } +} + +func TestSignVerify(t *testing.T) { + data := "Hello, World" + sign, err := xrsa.Sign(data) + if err != nil { + t.Fatal(err.Error()) + } + + err = xrsa.Verify(data, sign) + if err != nil { + t.Fatal(err.Error()) + } +} + +func TestCrossLanguage(t *testing.T) { + var data = make(map[string] string) + pubKey, err := ioutil.ReadFile("../../test/pub.pem") + if err != nil { + t.Fatal(err.Error()) + } + priKey, err := ioutil.ReadFile("../../test/pri.pem") + if err != nil { + t.Fatal(err.Error()) + } + testData, err := ioutil.ReadFile("../../test/data.json") + if err != nil { + t.Fatal(err.Error()) + } + err = json.Unmarshal(testData, &data) + if err != nil { + t.Fatal(err.Error()) + } + + rsa2, err := NewXRsa(pubKey, priKey) + if err != nil { + t.Fatal(err.Error()) + } + + decrypted, err := rsa2.PrivateDecrypt(data["encrypted"]) + if err != nil { + t.Fatal(err.Error()) + } + if string(decrypted) != data["data"] { + t.Fatal(fmt.Sprintf("Faild assert \"%s\" equals \"%s\"", decrypted, data)) + } + + decrypted, err = rsa2.PublicDecrypt(data["private_encrypted"]) + if err != nil { + t.Fatal(err.Error()) + } + if string(decrypted) != data["data"] { + t.Fatal(fmt.Sprintf("Faild assert \"%s\" equals \"%s\"", decrypted, data)) + } + + err = rsa2.Verify(data["data"], data["sign"]) + if err != nil { + t.Fatal(err.Error()) + } +} \ No newline at end of file