Skip to content

CLI for Acronis Notary to verify hash in Merkle Patricia Tree root/proof

License

Notifications You must be signed in to change notification settings

acronis/notary-verifyhash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Acronis Notary™ verifyhash CLI utility

Overview

Acronis Notary™ verifyhash CLI utility is created to verify Merkle Tree/Merkle Patricia Tree root and proof. This operation is a part of manual verification process for certificates generated by Acronis Notary™.

MIT licensed

Building the Module

To build the module, you need to have the Make utility and Docker installed on your machine.

Windows

Install Make

    Winget install GnuWin32.make --location "C:\MinGW"

Install Docker : https://docs.docker.com/desktop/windows/install/ Note: Hyper-V must be enabled for Docker for Windows. For more details how to enable Hyper-V, refer to https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v. Ensure that no other virtualization software is enabled along with Hyper-V, otherwise it will cause a conflict.

Type C:\MinGW\bin\make.exe in the root repository folder and press Enter.

    C:\MinGW\bin\make.exe

The binaries will be created in the root repository folder

Linux

Install Make (redhat/centos)

    sudo yum install make

Install Make (ubuntu)

    sudo apt-get install make

Install Docker : https://docs.docker.com/desktop/linux/install/

Type make in the root repository folder and press Enter.

    make

The binaries will be created in the root repository folder

MacOS (NOTE: We do not support Mac with M1 chip)

Install Make (Command line tools)

    xcode-select --install

Install Docker : https://docs.docker.com/desktop/mac/install/

Type make in the root repository folder and press Enter.

    make

The binaries will be created in the root repository folder

How to use

Print the verifyhash help

$ ./verifyhash --help

USAGE:
   verifyhash [global options]

   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
   --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

Verify Merkle Patricia Tree

$ ./verifyhash --cert=a8deb1a8ecd60007699d0f9108434c316a1e74f3e69f32fdc7ee3875b47e6f65 --root=48b545fc340bbb5443e1ea59ad7031231fd5997baf738583cf1b02ff32b934bb --proof="[\"f90111a04859bd25820e591e8d48c850f5f3ed9857a4477ea69921e57143a6e85a2ba1398080a0c736c0a016de219c26519ef4db17e04dbded88b9e6a522c6ffed82a55001ab31a080323e8f701e3042c688415a44e55bd36d2fa41cba8df14aea0eede6e0592b938080808080a0e6dadefefb174be9ce76a350f7890ab604bf2aad660dbf47fc2c601db7973e35a0a2da8847b294dbecb823dfea26f9dc1303f9fca39d754623f8769ebfa71add44a01e88e5f64778fb794a5b004740a0278f7fb76256b3b3acbdb0f02ec86eb6af6e80a0965de56d9818e1e65485d67c9739d7b60832eca6c21d5552f48a16fcb02b11cda099a958d2d407f267559027f528ac78b6a2fd173479356b057d12837c6fdc62fd80\",\"f842a038deb1a8ecd60007699d0f9108434c316a1e74f3e69f32fdc7ee3875b47e6f65a03665383038653465383263663830333139323830396661343135326265333231\"]" --etag=6e808e4e82cf803192809fa4152be321

Verify Merkle Tree

$ ./verifyhash --root=543a5b1d24df27386fd138a84fe02badf2ca98603cabd06267e4b56e2c0a7c79 --proof="[{\"right\":\"8fbda2c989ea391cc5afdd2270cbd3802132a0a25b03db0d40d9473887881c7e\"},{\"left\":\"e1122abf373076abb65af59b8e1492f7d026774cb9225fac377df55611f1d6e6\"},{\"left\":\"35246b8c8713282bce735db1ca4c6c054e4b6b51b0c1e5bd1857feef5c86554f\"},{\"right\":\"d3a22c30a455ca220b5e45cbc4f5279a6144d6288c00557d269455f44cf53bd5\"}]" --etag=7b2febf73e033aec3270d4b5ba7ee1f666f2b01944d011c8ce5f02b86f0c5c0f

Copyright © 2019-2022 Acronis International GmbH. This is distributed under MIT license.