-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from onrik/master
Support classic merkle tree
- Loading branch information
Showing
384 changed files
with
155,024 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: go | ||
|
||
go: | ||
- 1.7 | ||
- tip | ||
|
||
before_install: | ||
- go get github.com/stretchr/testify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Acronis Notary™ verifyhash CLI utility | ||
## Overview | ||
CLI for Acronis Notary created to verify that a key is included in Merkle Patricia Tree root and proof. It returns boolean and a value, stored inside the proof for given root and key. This operation is a part of a manual verification process for certificates generated by Acronis Notary™. | ||
CLI for Acronis Notary created to verify Merkle Tree and Merkle Patricia Tree root and proof. This operation is a part of a manual verification process for certificates generated by Acronis Notary™. | ||
|
||
[](https://raw.githubusercontent.com/hyperium/hyper/master/LICENSE) | ||
|
||
## Installation | ||
|
||
1. Clone the repository `mkdir verifyhash && git clone [email protected]:acronis/notary-verifyhash.git && cd verify` | ||
1. Clone the repository `mkdir verifyhash && git clone [email protected]:acronis/notary-verifyhash.git verifyhash && cd verifyhash` | ||
2. Build and install dependencies `go get -d ./... && go install` | ||
|
||
## How to use | ||
|
@@ -19,41 +19,33 @@ $ verifyhash --help | |
USAGE: | ||
verifyhash [global options] | ||
Required flags: -c|-o|-fo, -p|-fp, -r | ||
Required flags: -c, -r, -p, -e | ||
COMMANDS: | ||
help, h Shows a list of commands or help for one command | ||
GLOBAL OPTIONS: | ||
--cert value, -c value ID of certificate | ||
--object value, -o value "Object" from certificate | ||
--fobject value, --fo value Path to the file with the "object" from certificate | ||
--root value, -r value Merkle root | ||
--proof value, -p value Merkle proof | ||
--fproof value, --fp value Path to the file with merkle proof | ||
--help, -h show help | ||
--version, -v print the version | ||
--cert value, -c value ID of certificate | ||
--root value, -r value Merkle root | ||
--proof value, -p value Merkle proof | ||
--etag value, -e value File eTag | ||
--help, -h show help | ||
--version, -v print the version | ||
``` | ||
|
||
|
||
#### Example usage | ||
|
||
In a basic scenario the utility accepts certificate id, merkle patricia root, and merkle patricia proof | ||
Verify Merkle Patricia Tree | ||
|
||
` | ||
$ verifyhash -c 7f420817b35d23a9e6f52fa715bffee975c009340419d82d596b700ef03222e9 -r b829f2d554623b22b6ee431dff294e71f24eab79ddc1f83435a2cc606ca53623 -p [\"f843a1207f420817b35d23a9e6f52fa715bffee975c009340419d82d596b700ef03222e9a03131656533626565393065666433383237323465376135643631666531376430\"] | ||
$ ./verifyhash --cert=a8deb1a8ecd60007699d0f9108434c316a1e74f3e69f32fdc7ee3875b47e6f65 --root=48b545fc340bbb5443e1ea59ad7031231fd5997baf738583cf1b02ff32b934bb --proof="[\"f90111a04859bd25820e591e8d48c850f5f3ed9857a4477ea69921e57143a6e85a2ba1398080a0c736c0a016de219c26519ef4db17e04dbded88b9e6a522c6ffed82a55001ab31a080323e8f701e3042c688415a44e55bd36d2fa41cba8df14aea0eede6e0592b938080808080a0e6dadefefb174be9ce76a350f7890ab604bf2aad660dbf47fc2c601db7973e35a0a2da8847b294dbecb823dfea26f9dc1303f9fca39d754623f8769ebfa71add44a01e88e5f64778fb794a5b004740a0278f7fb76256b3b3acbdb0f02ec86eb6af6e80a0965de56d9818e1e65485d67c9739d7b60832eca6c21d5552f48a16fcb02b11cda099a958d2d407f267559027f528ac78b6a2fd173479356b057d12837c6fdc62fd80\",\"f842a038deb1a8ecd60007699d0f9108434c316a1e74f3e69f32fdc7ee3875b47e6f65a03665383038653465383263663830333139323830396661343135326265333231\"]" --etag=6e808e4e82cf803192809fa4152be321 | ||
` | ||
|
||
In the alternative way, the utility accepts `object`, merkle patricia root, and merkle patricia proof | ||
Verify Merkle Tree | ||
|
||
` | ||
$ verifyhash -o {\"eTag\": \"11ee3bee90efd382724e7a5d61fe17d0\", \"key\":\"init.sql\",\"sequencer\": \"24EA5D176F5F21959E\",\"size\": 5391} -r b829f2d554623b22b6ee431dff294e71f24eab79ddc1f83435a2cc606ca53623 -p [\"f843a1207f420817b35d23a9e6f52fa715bffee975c009340419d82d596b700ef03222e9a03131656533626565393065666433383237323465376135643631666531376430\"] | ||
` | ||
|
||
The utility could also read an object or proof from files. There is no need to escape characters in files. | ||
|
||
` | ||
$ verifyhash -fo "path/to/objectfile" -r b829f2d554623b22b6ee431dff294e71f24eab79ddc1f83435a2cc606ca53623 -fp "path/to/prooffile" | ||
$ ./verifyhash --root=543a5b1d24df27386fd138a84fe02badf2ca98603cabd06267e4b56e2c0a7c79 --proof="[{\"right\":\"8fbda2c989ea391cc5afdd2270cbd3802132a0a25b03db0d40d9473887881c7e\"},{\"left\":\"e1122abf373076abb65af59b8e1492f7d026774cb9225fac377df55611f1d6e6\"},{\"left\":\"35246b8c8713282bce735db1ca4c6c054e4b6b51b0c1e5bd1857feef5c86554f\"},{\"right\":\"d3a22c30a455ca220b5e45cbc4f5279a6144d6288c00557d269455f44cf53bd5\"}]" --etag=7b2febf73e033aec3270d4b5ba7ee1f666f2b01944d011c8ce5f02b86f0c5c0f | ||
` | ||
|
||
## License | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.