Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
BUILD.bazel | H A D | 25-Apr-2025 | 1.2 KiB | 39 | 34 | |
README.md | H A D | 25-Apr-2025 | 1,011 | 36 | 25 | |
SignatureExample.java | H A D | 25-Apr-2025 | 3 KiB | 88 | 43 | |
signature_example_test.sh | H A D | 25-Apr-2025 | 3.7 KiB | 118 | 53 | |
signature_test_private_keyset.json | H A D | 25-Apr-2025 | 429 | 12 | 11 | |
signature_test_public_keyset.json | H A D | 25-Apr-2025 | 384 | 13 | 12 |
README.md
1# Java digital signature example 2 3This is an example showing how to sign and verify data with Tink using digital 4signatures. 5 6It demonstrates the basic steps of using Tink, namely loading key material, 7obtaining a primitive, and using the primitive to do crypto. 8 9The key material was generated with: 10 11```shell 12tinkey create-keyset --key-template ECDSA_P256 --out-format JSON \ 13 --out signature_test_private_keyset.json 14tinkey create-public-keyset --in signature_test_private_keyset.json \ 15 --in-format JSON --out-format JSON --out signature_test_public_keyset.json 16``` 17 18## Build and Run 19 20### Bazel 21 22```shell 23git clone https://github.com/google/tink 24cd tink/examples/java_src 25bazel build ... 26 27echo "some data" > data.txt 28touch signature_file.txt 29 30./bazel-bin/signature/signature_example sign \ 31 ./signature/signature_test_private_keyset.json data.txt signature_file.txt 32 33./bazel-bin/signature/signature_example verify \ 34 ./signature/signature_test_public_keyset.json data.txt signature_file.txt 35``` 36