forked from lapo-luchini/asn1js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
113 lines (113 loc) · 6.73 KB
/
index.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html data-theme="dark">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="theme-color" content="#0d1116" media="(prefers-color-scheme: dark)">
<meta name="theme-color" content="#C0C0C0" media="(prefers-color-scheme: light)">
<title>ASN.1 JavaScript decoder</title>
<link rel="stylesheet" href="index.css" type="text/css">
<link rel="icon" type="image/svg+xml" sizes="192x192" href="favicon.svg">
</head>
<body>
<div id="contextmenu">
<button id="btnCopyHex">Copy hex dump</button>
<button id="btnCopyB64">Copy Base64</button>
<button id="btnCopyTree">Copy subtree</button>
<button id="btnCopyValue">Copy value</button>
</div>
<header>
<div class="title">
<h1>ASN.1 JavaScript decoder</h1>
</div>
<div class="menu">
<form>
<input id="butClear" type="button" value="clear">
<select id="theme-select">
<option value="os">OS Theme</option>
<option value="dark">Dark Theme</option>
<option value="light">Light Theme</option>
</select>
</form>
</div>
</header>
<div id="main-page">
<div>
<div id="dump"></div>
<div id="tree"></div>
</div>
<form>
<textarea id="area" rows="8"></textarea>
<br>
<br>
<label title="can be slow with big files"><input type="checkbox" id="wantHex" checked="checked"> with hex dump</label>
<label title="can be slow with big files"><input type="checkbox" id="trimHex" checked="checked"> trim big chunks</label>
<label title="can be slow with big files"><input type="checkbox" id="wantDef" checked="checked"> with definitions</label>
<input id="butDecode" type="button" value="decode">
<br><br>
<table>
<tr><td>Drag or load file:</td><td><input type="file" id="file"></td></tr>
<tr id="rowExamples"><td>Load examples:</td><td>
<select id="examples">
<option value="sig-p256-der.p7m">PKCS#7/CMS attached signature (DER)</option>
<option value="sig-p256-ber.p7m">PKCS#7/CMS attached signature (BER)</option>
<option value="sig-rsa1024-sha1.p7s">PKCS#7/CMS detached signature (old)</option>
<option value="cms-password.p7m">PKCS#7/CMS encrypted with password</option>
<option value="letsencrypt-x3.cer">X.509 certificate: Let's Encrypt X3</option>
<option value="ed25519.cer">X.509 certificate: ed25519 (RFC 8410)</option>
<option value="pkcs1.pem">PKCS#1 RSA key (RFC 8017)</option>
<option value="pkcs8-rsa.pem">PKCS#8 RSA key (RFC 5208)</option>
<option value="pkcs10.pem">PKCS#10 certification request (RFC 2986)</option>
<option value="cmpv2.b64">CMP PKI message (RFC 4210)</option>
</select>
<input id="butExample" type="button" value="load"><br>
</td></tr>
<tr><td>Definitions:</td><td><select id="definitions"></select></td></tr>
</table>
</form>
<br>
</div>
<div id="help">
<h2>Instructions</h2>
<p>This page contains a JavaScript generic ASN.1 parser that can decode any valid ASN.1 DER or BER structure whether Base64-encoded (raw base64, PEM armoring and <span class="tt">begin-base64</span> are recognized) or Hex-encoded. </p>
<p>This tool can be used online at the address <a href="https://asn1js.eu/"><span class="tt">https://asn1js.eu/</span></a> or offline, unpacking <a href="https://asn1js.eu/asn1js.zip">the ZIP file</a> in a directory and opening <span class="tt">index.html</span> in a browser</p>
<p>On the left of the page will be printed a tree representing the hierarchical structure, on the right side an hex dump will be shown. <br>
Hovering on the tree highlights ancestry (the hovered node and all its ancestors get colored) and the position of the hovered node gets highlighted in the hex dump (with header and content in a different colors). <br>
Clicking a node in the tree will hide its sub-nodes (collapsed nodes can be noticed because they will become <i>italic</i>).</p>
<p><b>WARNING:</b> starting from 2024-03-28 this website is using ES6 features (and modules), which can break it for <a href="https://caniuse.com/es6-module">very old browsers</a>.<br>
You can access <a href="https://rawcdn.githack.com/lapo-luchini/asn1js/1.2.4/index.html">last version before ES6 on githack</a> (which <a href="https://www.browserling.com/browse/win7/ie11/https://rawcdn.githack.com/lapo-luchini/asn1js/1.2.4/index.html">still works on IE11</a>).</p>
<div class="license">
<h3>Copyright</h3>
<div><p class="hidden">
ASN.1 JavaScript decoder<br>
Copyright © 2008-2024 Lapo Luchini <a href="mailto:[email protected]?subject=ASN1js"><[email protected]></a><br>
<br>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.<br>
<br>
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</p></div>
<p>ASN.1 JavaScript decoder Copyright © 2008-2024 <a href="https://lapo.it/">Lapo Luchini</a>; released as <a href="https://opensource.org/licenses/isc-license.txt">opensource</a> under the <a href="https://en.wikipedia.org/wiki/ISC_licence">ISC license</a>.</p>
</div>
<p><span class="tt">OBJECT IDENTIFIER</span> values are recognized using data taken from Peter Gutmann's <a href="https://www.cs.auckland.ac.nz/~pgut001/#standards">dumpasn1</a> program.</p>
<h3>Links</h3>
<ul>
<li><a href="https://asn1js.eu/">official website</a></li>
<li><a href="https://lapo.it/asn1js/">alternate website</a></li>
<li><a href="https://asn1js.eu/index-local.html">single-file version working locally</a> (just save this link)</li>
<li>previous versions on githack: <select id="tags"><option>[select tag]</option></select></li>
<li><a href="http://idf.lapo.it/p/asn1js/">InDefero tracker</a> (currently offline)</li>
<li><a href="https://github.com/lapo-luchini/asn1js">github mirror</a></li>
<li><a href="https://www.openhub.net/p/asn1js">OpenHub code stats</a></li>
</ul>
</div>
<script type="module" src="index.js"></script>
</body>
</html>