-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign.html
40 lines (40 loc) · 2.03 KB
/
sign.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Web Crypto sign demo</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row pt-3">
<a href="https://www.excid.io"><img src="logo.svg" alt="excid logo" height="60"/></a>
<p class="lead">Sign text using Web Crypto</p>
<p>This page is an experiment. </p>
</div>
<div class="card mt-3" id="step1">
<h5 class="card-header">Step 2</h5>
<div class="card-body">
<h5 class="card-title">Sign data</h5>
<p class="card-text">Use the form below and let the browser auto-complete the saved key. </p>
<div id="form" class="mt-3" >
<form method="get">
<label for="username" class="form-label">Key nickname
<input type="text" class="form-control" name="username" autocomplete="username" />
<label for="password" class="form-label">Private key
<input type="password" class="form-control" name="password" id="password" autocomplete="current-password"/><br/>
<label for="textToSign" class="form-label">Text to sign <small class="text-secondary">Normally, this would be a VC or DID document</small></label>
<textarea class="form-control" id="textToSign" rows="3">Hello world!</textarea> <br/>
</form>
</div>
<button onclick="sign()" class="btn btn-primary">Generate signature</button>
<p>Signature:
<code id="signature"></code>
</p>
</div>
</div>
</div>
<script src="web-crypto-sign.js"></script>
</body>
</html>