|
1 | 1 |
|
2 | 2 |
|
3 | 3 |
|
4 | | - |
| 4 | +<!DOCTYPE html> |
5 | 5 |
|
6 | 6 | <html> |
7 | 7 |
|
8 | 8 | <head> |
| 9 | + <meta charset=utf-8> |
9 | 10 |
|
10 | | - <title>sign/verify file</title> |
| 11 | + <title> |
| 12 | + Sign / Verify File |
| 13 | + </title> |
| 14 | + |
| 15 | + <meta name=description content='sign or verify a file with a cryptographic signature using x509 certificates'> |
11 | 16 |
|
12 | 17 | <base href='https://ext-code.com/utils/x509/sign-verify/'> |
13 | | - <base href='https://javascript-2020.github.io/utils/x509/sign-verify/'> |
| 18 | + <link rel=canonical href='https://ext-code.com/utils/x509/sign-verify/sign-verify.html'> |
14 | 19 |
|
15 | | - <link rel='shortcut icon' type='image/x-icon' href='images/favicon.ico'> |
16 | | - |
| 20 | + <link rel=icon href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAP1BMVEVHcEyR2pGP242O242P246X1ZeP246Q2o+T2ZKQ2o+O242Q2o+P246P2o6Q2ZCR2ZCR2ZGP246Q2o6P246O243EYZFGAAAAFHRSTlMAF9rprQXPQAxl9k6gkTIoH7xyuzEuK6IAAADQSURBVCjPtZPbEoMgDES5hDuIlfz/t7YUREHsTDvTfQIOE9dkIeQbCfGJRu+Xe+okItv0HK7BYhaoGdwYVvGwdBaoMr7B9wUwiu5Ug8WLLOweKMOJGP0D5on3WMszdSK8F3K3JlI1yzMltGxT+3dfcIg+Uyg739piysFG6NIomoYXXj9LDsqP0elHPTJxp5hOgzN4mLvUfpWUY1MkPc/MDEOxppu2hh7DEJnYlZdxTIs6NZ5P4uQaZ24WRVXrSzWPKs1RtWG9fSMKQImfH9FFT2olG93t/+JzAAAAAElFTkSuQmCC'> |
| 21 | + <meta name=viewport content='width=device-width, initial-scale=1'> |
| 22 | + |
| 23 | + <script type='application/ld+json'> |
| 24 | + { |
| 25 | + "@context" : "https://schema.org", |
| 26 | + "@type" : "SoftwareApplication", |
| 27 | + "name" : "Sign and Verify a file", |
| 28 | + "url" : "https://ext-code.com/utils/x509/sign-verify/sign-verify.html", |
| 29 | + "author" : {"@type":"Person","name":"Matthew Richards"}, |
| 30 | + "description" : "Generate rsa keypair", |
| 31 | + "applicationCategory" : "DeveloperApplication", |
| 32 | + "operatingSystem" : "All", |
| 33 | + "browserRequirements" : "Requires JavaScript-enabled browser", |
| 34 | + "softwareVersion" : "1.0.0", |
| 35 | + "offers" : {"@type":"Offer","price":"0","priceCurrency":"GBP"} |
| 36 | + } |
| 37 | + </script> |
| 38 | + |
| 39 | + |
| 40 | + <script src='https://libs.ext-code.com/js/dom/component/component.js'></script> |
| 41 | + |
| 42 | + <script init> |
| 43 | + console.clear(); |
| 44 | + console.log('sign-verify-file.html'); |
| 45 | + console.log(); |
| 46 | + console.json=v=>console.log(JSON.stringify(v,null,4)); |
| 47 | + |
| 48 | + var df=true,did='html' |
| 49 | + ; |
| 50 | + |
| 51 | + var ext; |
| 52 | + var $; |
| 53 | + var datatype; |
| 54 | + var menumod; |
| 55 | + var keydown; |
| 56 | + var debug; |
17 | 57 |
|
18 | 58 |
|
19 | | - <script init> |
| 59 | + var menu; |
| 60 | + |
| 61 | + |
| 62 | + var hdr; |
| 63 | + |
| 64 | + //: |
| 65 | + |
20 | 66 |
|
| 67 | + async function init(){ |
| 68 | + |
| 69 | + |
| 70 | + await load(); |
| 71 | + |
| 72 | + |
| 73 | + menu = menumod(); |
| 74 | + |
| 75 | + mod.base.add({ext,$,datatype,keydown,menu,menumod}); |
| 76 | + |
| 77 | + |
| 78 | + hdr = mod['x509-hdr']; |
| 79 | + |
| 80 | + hdr.initmod({ext,$,menu}); |
| 81 | + |
| 82 | + await Promise.all([ |
| 83 | + hdr.init(), |
| 84 | + ]); |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + initdom(document.body); |
| 89 | + |
| 90 | + |
| 91 | + console.log('ready'); |
| 92 | + }//init |
| 93 | + |
| 94 | + |
| 95 | +(async()=>{ |
| 96 | + |
| 97 | + mod.stack.add; |
| 98 | + |
| 99 | + var {ext} = await import('https://libs.ext-code.com/js/io/ext-loader/ext-loader.m.js'); |
| 100 | + |
| 101 | + var promise = ext.load.libs( |
| 102 | + 'js/dom/$.js.api', |
| 103 | + 'js/core/datatype.js', |
| 104 | + 'js/dom/menumod/menumod.js', |
| 105 | + 'js/dom/keydown/keydown.js', |
| 106 | + 'js/debug/debug.js', |
| 107 | + ); |
| 108 | + [$,datatype,menumod,keydown,debug] = await promise; |
| 109 | + |
| 110 | + |
| 111 | + mod.stack.complete; |
| 112 | + |
| 113 | +})(); |
| 114 | + |
| 115 | + |
| 116 | + async function load(){ |
| 117 | + |
| 118 | + var txt = localStorage['node-forge']; |
| 119 | + if(!txt){ |
| 120 | + var url = 'https://cdn.jsdelivr.net/npm/node-forge/+esm'; |
| 121 | + //console.log(url); |
| 122 | + var res = await fetch(url); |
| 123 | + txt = await res.text(); |
| 124 | + localStorage['node-forge'] = txt; |
| 125 | + } |
| 126 | + var blob = new Blob([txt],{type:'text/javascript'}); |
| 127 | + var url = window.URL.createObjectURL(blob); |
| 128 | + nodeforge = await import(url); |
| 129 | + nodeforge = nodeforge.default; |
| 130 | + console.log(nodeforge); |
| 131 | + |
| 132 | + }//load |
| 133 | + |
| 134 | + |
21 | 135 | </script init> |
22 | 136 |
|
| 137 | + |
23 | 138 |
|
24 | 139 | <style> |
25 | 140 |
|
|
74 | 189 | .filename |
75 | 190 | {font-size:12px;padding:5px} |
76 | 191 |
|
| 192 | + |
| 193 | + .visually-hidden |
| 194 | + {position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important; |
| 195 | + clip:rect(0 0 0 0) !important;white-space:nowrap !important;border:0 !important} |
| 196 | + |
| 197 | + |
77 | 198 | </style> |
78 | 199 |
|
79 | 200 | </head> |
80 | 201 |
|
81 | 202 | <body> |
82 | | - |
| 203 | + |
| 204 | + |
| 205 | + <x509-hdr component=grp v2.0> |
| 206 | + <h1 class=visually-hidden> |
| 207 | + Sign and Verify File |
| 208 | + </h1> |
| 209 | + <img class=title src='images/sign-verify.png' style='top:5px;height:55px' alt='sign and verify file'> |
| 210 | + <time slot=date datetime=2025-11-15> |
| 211 | + 15 Nov 2025 |
| 212 | + </time> |
| 213 | + </x509-hdr> |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | +<!-- |
83 | 218 | <div class=hdr> |
84 | 219 | <a class=hdr-icon href='https://javascript-2020.github.io/'> |
85 | 220 | <img class=hdr-icon-img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAqFBMVEVHcEwjmpckopg9f3YxpJM6r5kjq58Nmp0Nn6QRoKExrpshnpgtoJUdoZwYnZ02spwYpaEmrZ8djpINn6Qtrp4inpcjqZ8SoqM3s5w0sp01spwrr58vr50oqpwdnpo0sZwtrJwUpKMMoaUtq50op5ssqpopppseqaM1sJwgpJ0NoaUSoaI3kYobqaMSpKQrr58PoaMVpaIOoKMLpKcXpaEkqp8Rm58YrKUL0CR4AAAAOHRSTlMACBkBCyinK59CQhUOLyKjqbUGpZgSYn6rp5WsekcmgkyWmCkmNB7AYTiuVgKuuo91i2PLn2lJ7kISMf4AAAElSURBVCjPrdPXloIwEAbgBDFKCRo6SO8lYEHd93+zxV7Zm2WuSL6Tk/MPEwBGLFH8SzFCeFiDXNeJ+7GtGds1D+ghDzzPzXX6xlJbq75s5KVLiJsSB76xIhd22Mz0pkyRnqzW2htD/SeUjL0EQKY60nqRvTLXGl64PR/SfDVxVvETZ123w8vN9Ur5YKUF4R9cd/WxqiePgCs3IMF1QXcVt6vK59tSqyjN4hwQbhS8mUuvWTLbwYtTQGhEjLHVPprv+4ztQ8AeRVn50uipBcXg/IPgfPaFF+z1axyeMEkcJwwdYHHZINQ02gALS49lJcQMci/COGzdue8apRQwNz4tYvM207JSRVEUhvtW6KeBIFVVbds07xPncZfCfWSK+UtNJ/9+VL/nTBuX7xjDZwAAAABJRU5ErkJggg==' /> |
|
100 | 235 | 24 Apr 2025 |
101 | 236 | </div> |
102 | 237 | </div hdr> |
103 | | - |
| 238 | +--> |
| 239 | + |
| 240 | + |
104 | 241 | <div id=btns> |
105 | 242 | <input value=sign type=button style='margin-right:20px'> |
106 | 243 | <input value=verify type=button style='margin-right:10px'> |
|
170 | 307 |
|
171 | 308 |
|
172 | 309 | <script> |
173 | | - console.clear(); |
174 | | - console.log('sign/verify.html'); |
175 | | - console.log(); |
176 | | - console.json=v=>console.log(JSON.stringify(v,null,4)); |
| 310 | + |
177 | 311 |
|
178 | 312 | var $ = (root,sel)=>(!sel && (sel=root,root=document),root.querySelector(sel)); |
179 | 313 | $.style = (node,style)=>{ |
|
208 | 342 | var extract = {}; |
209 | 343 | var is = {}; |
210 | 344 | is.public = {}; |
211 | | - var load = {}; |
212 | 345 | var btn = {}; |
213 | 346 | btn.private = {}; |
214 | 347 | btn.public = {}; |
|
220 | 353 | // |
221 | 354 |
|
222 | 355 |
|
223 | | - setTimeout(init,50); |
224 | | - |
225 | | - async function init(){ |
226 | | - |
227 | | - await load.nodeforge(); |
228 | | - |
229 | | - initdom(); |
230 | | - |
231 | | - |
232 | | - |
233 | | - |
234 | | - //test(); |
235 | | - //test2(); |
236 | | - |
237 | | - |
238 | | - |
239 | | - |
240 | | - }//init |
241 | | - |
242 | 356 |
|
243 | 357 | function initdom(){ |
244 | 358 |
|
245 | 359 | var rootnode = document.body; |
246 | 360 |
|
247 | 361 | var root = {}; |
248 | 362 |
|
| 363 | + |
| 364 | + hdr.initdom(); |
| 365 | + |
249 | 366 |
|
250 | 367 | root.btns = $(rootnode,'#btns'); |
251 | 368 |
|
|
480 | 597 |
|
481 | 598 | //: |
482 | 599 |
|
483 | | - load.nodeforge = async function(){ |
484 | | - |
485 | | - var txt = localStorage['node-forge']; |
486 | | - if(!txt){ |
487 | | - var url = 'https://cdn.jsdelivr.net/npm/node-forge/+esm'; |
488 | | - //console.log(url); |
489 | | - var res = await fetch(url); |
490 | | - txt = await res.text(); |
491 | | - localStorage['node-forge'] = txt; |
492 | | - } |
493 | | - var blob = new Blob([txt],{type:'text/javascript'}); |
494 | | - var url = window.URL.createObjectURL(blob); |
495 | | - nodeforge = await import(url); |
496 | | - nodeforge = nodeforge.default; |
497 | | - console.log(nodeforge); |
498 | | - |
499 | | - }//nodeforge |
500 | 600 |
|
501 | 601 |
|
502 | 602 | load.file = function(){ |
|
0 commit comments