FreeTSA is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install freetsa
It will make the freetsa command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall freetsa uninstalls.
Adding freetsa library as a dependency
Run this command in a terminal, in your project's directory:
cargo add freetsa
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
freetsa = "0.1.3"
The freetsa library will be automatically available globally.
Read the freetsa library documentation .
Back to the crate overview .
Readme
FreeTSA Unofficial Client Library and CLI Utility
See https://freetsa.org for more information on this public timestamp service.
Note: To verify timestamps, you will need to fetch copies of FreeTSA's certificates from their website.
Using CLI
$ cargo install freetsa
$ freetsa timestamp file \
--data some_file \
--reply-out some_file.tsr \
--query-out some_file.tsq
$ openssl ts - verify \
-in some_file.tsr \
-queryfile some_file.tsq \
-CAfile cacert.pem \
-untrusted tsa.crt
Using Library
use freetsa:: prelude:: * ;
// timestamp a hash that you generate
let hash: Vec < u8 > = _generate_your_hash_somehow ( ) ;
let TimestampResponse { reply, .. } = timestamp_hash ( hash) . await. unwrap ( ) ;
// timestamp a sha512 hash generated for you from a file you specify
let TimestampResponse { query, reply } = timestamp_file ( " path/to/my/file" ) . await. unwrap ( ) ;
Example code is available for timestamping a file or timestamping a hash . You can run them using just with just example- file and just example- hash , respectively.