Skip to content

code4fukui/trustday

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trustday

  • trusted day stamp service with sec.js

How to start

deno run -A server.js

Usage

sign

import { fetchCBOR } from "https://js.sabae.cc/fetchCBOR.js";

const url = "http://localhost:8000/api/";
const data = new Uint8Array([1, 2, 3]);
const sign = await fetchCBOR(url, data);
console.log(sign);

verify

import { fetchBin } from "https://js.sabae.cc/fetchBin.js";
import { Day, TimeZone } from "https://js.sabae.cc/DateTime.js";
import * as sec from "https://code4fukui.github.io/sec.js/sec.js";

// set sign, data

const day = new Day(TimeZone.JST).toString();
const url2 = "http://localhost:8000/" + day + ".pubkey";
const pubkey = await fetchBin(url2);
const b = sec.verify(sign, pubkey, data);
console.log("verify", b);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published