-
Notifications
You must be signed in to change notification settings - Fork 0
/
hankomaker.html
55 lines (42 loc) · 1.48 KB
/
hankomaker.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html><html><head><meta charset="utf-8">
<style>
input[type="text"] {
font-size: 80%;
font-family: monospace;
width: 50em;
}
</style>
<h1>HANKOを作る</h1>
<button id=btn>HANKOを作る</button><br>
<br>
HANKO_ID(公開するハンコID)<br>
<input type=text id=pub><br>
HANKO_SEC (秘密にするハンコ鍵)<br>
<input type=text id=pri><br>
<script type="module">
import { Ed25519 } from "https://code4sabae.github.io/js/Ed25519.js";
import { hex } from "https://code4sabae.github.io/js/hex.js";
btn.onclick = () => {
const seed = Ed25519.createSeed();
const keys = Ed25519.createKeyPair(seed);
console.log('keys', keys);
const pubpem = hex.fromBin(keys.publicKey);
console.log("pubpem", pubpem);
pub.value = pubpem;
const pripem = hex.fromBin(keys.secretKey);
console.log("pripem", pripem);
pri.value = pripem;
};
</script>
<br>
次は?<br>
<a href=hankosign.html target=_blank>HANKOを押す(メッセージに電子署名する)</a><br>
<hr>
<a href=hankomaker.html>HANKOをつくる</a><br>
<a href=hankosign.html>HANKOを押す(メッセージに電子署名する)</a><br>
<a href=hankosignchk.html>HANKOを確認する(電子署名を確認する)</a><br>
<hr>
App: CC BY <a href=https://fukuno.jig.jp/3006>福野泰介の一日一創</a><br>
Lib: <a href=https://github.com/canonchain/Ed25519-wasm>Ed25519-wasm</a> → <a href=https://github.com/code4sabae/js/blob/master/Ed25519.js>Ed25519.js ES module version</a><br>
</body>
<html>