tree: d2c664870c35541e2d469f4b0158c850a866abff [path history] [tgz]
  1. BUILD.bazel
  2. README.md
  3. digital_signatures_cli.cc
  4. digital_signatures_cli_test.sh
  5. util.cc
  6. util.h
examples/digital_signatures/cc/README.md

C++ Digital Signatures CLI

This is a command-line tool that can generate Digital Signature keys, and create and verify digital signatures.

It demonstrates the basic steps of using Tink, namely loading key material, obtaining a primitive, and using the primitive to do crypto.

Moreover, since this app shares the same Bazel WORKSPACE with Tink, its BUILD file can directly depend on Tink.

Build and Run

Bazel

git clone https://github.com/google/tink
cd tink
bazel build ...
echo "a message" > message.txt
./bazel-bin/examples/digital_signatures/cc/digital_signatures_cli gen-private-key private_keyset.bin
./bazel-bin/examples/digital_signatures/cc/digital_signatures_cli get-public-key private_keyset.bin \
    public_keyset.bin
./bazel-bin/examples/digital_signatures/cc/digital_signatures_cli sign private_keyset.bin \
    message.txt signature.bin
./bazel-bin/examples/digital_signatures/cc/digital_signatures_cli verify public_keyset.bin \
    message.txt signature.bin result.txt
cat result.txt