timestamp verify - part-cw/lambdanative GitHub Wiki
(timestamp-verify hash tsr cafile)
timestamp-verify verifies a trusted timestamp.
Parameter | Description |
---|---|
hash | hash of file to be verified, e.g. (sha512sum filename) |
tsr | u8vector of timestamp response |
cafile | Filename of full TSA certificate chain |
Example
Example 1: Obtain a trusted timestamp for a file containing the string "LambdaNative" and verify its integrity
> (define filename "LNtest")
> (u8vector->file (u8vector 76 97 109 98 100 97 78 97 116 105 118 101) filename)
> (define tsr (timestamp-gettimestamp filename))
> (file-exists? (string-append filename ".tsr"))
#t
> (define cafile "chain.txt")
> (timestamp-verify (sha512sum filename) tsr cafile)
#t