WIP
Find a file
Mehmet Gurevin 70e34af4c2
Update README.md
added badges for doc and license
2020-06-29 04:34:35 +03:00
.gitignore Initial commit 2020-06-26 04:12:07 +03:00
auth.go improved documentation 2020-06-29 03:36:06 +03:00
client.go improved documentation 2020-06-29 03:36:06 +03:00
go.mod improved documentation 2020-06-29 03:36:06 +03:00
go.sum improved documentation 2020-06-29 03:36:06 +03:00
kamusm_ca.go improved documentation 2020-06-29 03:36:06 +03:00
LICENSE Initial commit 2020-06-26 04:12:07 +03:00
README.md Update README.md 2020-06-29 04:34:35 +03:00

go-zamane

WIP

Godoc license

Getting a signed timestamp:

algo := cryptoid.SHA512
digester := algo.Hash.New()

file, _ := os.Open("file-to-be-timestamped.txt")
io.Copy(digester, file)

client, _ := zamane.NewClient("999999", "12345678")

tsq, tsr, _ := client.RequestTimestamp(nil, digester.Sum(nil), algo)

tsqDER, _ := asn1.Marshal(*tsq)
tsrDER, _ := asn1.Marshal(*tsr)

ioutil.WriteFile("file-to-be-timestamped.tsq", tsqDER, 0644)
ioutil.WriteFile("file-to-be-timestamped.tsr", tsrDER, 0644)

Getting the amount of credit remaining:

client, _ := zamane.NewClient("999999", "12345678")
credit, _ := client.RemainingCredit(nil)

fmt.Printf("Remaining credit: %d\n", credit)