Skip to content

Commit acd9e69

Browse files
authored
Feature/142 (#180)
* Hashing / Encoding Tools page. * Digital Signature page. * HMAC signature support across numerous algorithms.
1 parent b247c06 commit acd9e69

20 files changed

Lines changed: 3274 additions & 25 deletions

README.md

Lines changed: 275 additions & 0 deletions
Large diffs are not rendered by default.

client/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ RUN browserify src/introspection.js -o public/js/introspection.js --debug --stan
7171

7272
RUN browserify src/logout.js -o public/js/logout.js --debug --standalone logout -t [ envify purge --CONFIG_FILE ${CONFIG_FILE} ]
7373
RUN browserify src/jwt_tools.js -o public/js/jwt_tools.js --debug --standalone jwt_tools -t [ envify purge --CONFIG_FILE ${CONFIG_FILE} ]
74+
RUN browserify src/encoding_tools.js -o public/js/encoding_tools.js --debug --standalone encoding_tools -t [ envify purge --CONFIG_FILE ${CONFIG_FILE} ]
75+
RUN browserify src/digital_signature.js -o public/js/digital_signature.js --debug --standalone digital_signature -t [ envify purge --CONFIG_FILE ${CONFIG_FILE} ]
7476
#COPY src/debugger2_js.js public/js
7577

7678
# ---- Code coverage (opt-in) ----
@@ -83,7 +85,7 @@ RUN if [ "$COVERAGE" = "true" ]; then \
8385
npm install --no-save babelify babel-plugin-istanbul @babel/core nyc ; \
8486
fi
8587
RUN if [ "$COVERAGE" = "true" ]; then \
86-
for entry in "jwks:jwks" "debugger:debug" "token_detail:token_detail" "debugger2:debugger2" "userinfo:userinfo" "introspection:introspection" "logout:logout" "jwt_tools:jwt_tools"; do \
88+
for entry in "jwks:jwks" "debugger:debug" "token_detail:token_detail" "debugger2:debugger2" "userinfo:userinfo" "introspection:introspection" "logout:logout" "jwt_tools:jwt_tools" "encoding_tools:encoding_tools" "digital_signature:digital_signature"; do \
8789
src_name="${entry%%:*}" ; \
8890
standalone="${entry##*:}" ; \
8991
browserify src/${src_name}.js -o public/js/${src_name}.js --debug --standalone ${standalone} -t [ envify purge --CONFIG_FILE ${CONFIG_FILE} ] -t [ babelify --plugins [ istanbul ] ] && \

client/build.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const BUNDLES = [
5151
['introspection', 'introspection'],
5252
['logout', 'logout'],
5353
['jwt_tools', 'jwt_tools'],
54+
['encoding_tools', 'encoding_tools'],
55+
['digital_signature', 'digital_signature'],
5456
];
5557

5658
const CALLBACK_HTML = `<!DOCTYPE html>

client/package-lock.json

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
},
1111
"dependencies": {
1212
"@fidm/x509": "^1.2.1",
13+
"@noble/curves": "1.4.0",
14+
"@noble/hashes": "1.4.0",
15+
"@noble/post-quantum": "^0.4.1",
1316
"@peculiar/asn1-pkcs8": "latest",
1417
"asn1js": "^3.0.10",
1518
"browserify": "^17.0.1",
@@ -18,14 +21,14 @@
1821
"dompurify": "latest",
1922
"envify": "latest",
2023
"express": "^4.22.2",
21-
"html-minifier-terser": "^7.2.0",
2224
"express-logging": "latest",
2325
"html-minifier-terser": "^7.2.0",
2426
"jquery": "latest",
2527
"jsonwebtoken": "latest",
2628
"jwk-to-pem": "latest",
2729
"jwks": "latest",
2830
"logops": "latest",
31+
"node-forge": "^1.3.1",
2932
"pem-file": "latest",
3033
"pkijs": "^3.4.0",
3134
"terser": "^5.44.0",
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
/* Compact layout for the Digital Signature (SLH-DSA) page. Mirrors the sizing
2+
used on the JWT Tools and Encoding / Hashing Tools pages. Loaded last so it
3+
overrides the shared container/legend/textarea rules. */
4+
5+
/* Widen the shared (otherwise narrow) bootstrap container for this page only */
6+
.container {
7+
width: 96%;
8+
max-width: 1500px;
9+
}
10+
11+
.ds-return {
12+
font-size: 0.85em;
13+
margin: 4px 0 2px;
14+
}
15+
16+
.ds-intro {
17+
font-size: 0.82em;
18+
line-height: 1.35;
19+
margin: 6px 0 10px;
20+
color: #444;
21+
}
22+
.ds-intro strong { color: #b00; }
23+
24+
/* Compact panes side by side; wrap to one column on narrow viewports. */
25+
.ds-grid {
26+
display: grid;
27+
grid-template-columns: repeat(auto-fit, minmax(300px, 460px));
28+
gap: 10px;
29+
align-items: start;
30+
justify-content: start;
31+
}
32+
@media (max-width: 640px) {
33+
.ds-grid { grid-template-columns: 1fr; }
34+
}
35+
36+
.ds-grid fieldset {
37+
border: 1px solid #aaa;
38+
border-radius: 6px;
39+
padding: 4px 10px 8px;
40+
margin: 0;
41+
min-width: 0;
42+
background: #fafafa;
43+
}
44+
.ds-grid legend {
45+
width: auto; /* override common.css legend { width: 540px } */
46+
font-weight: bold;
47+
font-size: 0.95em;
48+
padding: 0 6px;
49+
border: none;
50+
margin: 0;
51+
color: #333;
52+
}
53+
54+
/* Expand-all / collapse-all control row. */
55+
.ds-controls { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
56+
.ds-ctl-btn { font-size: 0.78em; padding: 3px 10px; cursor: pointer; }
57+
.ds-controls-hint { font-size: 0.72em; color: #777; }
58+
59+
/* Collapsible panes — click a legend to collapse/expand its fieldset. */
60+
.ds-grid legend { cursor: pointer; user-select: none; }
61+
.ds-grid legend::before { content: "\25be\00a0"; color: #666; font-size: 0.9em; } /* down triangle */
62+
.ds-grid fieldset.ds-collapsed legend::before { content: "\25b8\00a0"; } /* right triangle */
63+
.ds-grid fieldset.ds-collapsed > *:not(legend) { display: none; }
64+
.ds-grid fieldset.ds-collapsed { padding-bottom: 4px; }
65+
66+
/* Asymmetric / Symmetric badge on each pane legend */
67+
.ds-badge {
68+
font-size: 0.62em;
69+
font-weight: 700;
70+
padding: 1px 6px;
71+
border-radius: 10px;
72+
vertical-align: middle;
73+
margin-left: 6px;
74+
text-transform: uppercase;
75+
letter-spacing: 0.03em;
76+
}
77+
.ds-asym { background: #e6f0ff; color: #1b4b8f; border: 1px solid #b9d3f2; }
78+
.ds-sym { background: #f3e9ff; color: #5a2a8f; border: 1px solid #d8bef0; }
79+
80+
/* In-pane performance note (SLH-DSA) */
81+
.ds-note {
82+
font-size: 0.72em;
83+
line-height: 1.35;
84+
margin: 4px 0 8px;
85+
padding: 5px 8px;
86+
color: #663c00;
87+
background: #fff8e6;
88+
border: 1px solid #f0d48a;
89+
border-radius: 4px;
90+
}
91+
.ds-note code { font-size: 0.95em; }
92+
93+
.ds-field { margin: 0 0 5px; }
94+
.ds-field > label {
95+
display: block;
96+
font-size: 0.72em;
97+
font-weight: 600;
98+
color: #333;
99+
margin-bottom: 1px;
100+
}
101+
102+
/* Label carrying an inline Copy button next to the description */
103+
.ds-field > label.ds-has-copy {
104+
display: flex;
105+
align-items: center;
106+
justify-content: space-between;
107+
gap: 6px;
108+
}
109+
.ds-copy {
110+
font-size: 10px;
111+
font-weight: 600;
112+
padding: 1px 7px;
113+
line-height: 1.5;
114+
cursor: pointer;
115+
flex: 0 0 auto;
116+
}
117+
118+
.ds-grid textarea,
119+
.ds-grid input[type="text"],
120+
.ds-grid select {
121+
width: 100%;
122+
box-sizing: border-box;
123+
font-size: 0.8em;
124+
padding: 3px 4px;
125+
margin: 0;
126+
}
127+
.ds-grid textarea {
128+
font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
129+
resize: vertical;
130+
line-height: 1.25;
131+
}
132+
133+
/* Inline control rows (select + button, sign/validate buttons) */
134+
.ds-row {
135+
display: flex;
136+
gap: 6px;
137+
flex-wrap: wrap;
138+
align-items: flex-end;
139+
margin-bottom: 5px;
140+
}
141+
.ds-row > * { margin: 0; }
142+
.ds-grow { flex: 1 1 0; min-width: 0; }
143+
144+
.ds-grid input[type="submit"] {
145+
font-size: 0.8em;
146+
padding: 5px 12px;
147+
cursor: pointer;
148+
white-space: nowrap;
149+
}
150+
151+
/* Sub-section divider inside the pane (Key Pair) */
152+
.ds-sub {
153+
border-top: 1px dashed #bbb;
154+
margin-top: 8px;
155+
padding-top: 6px;
156+
}
157+
.ds-sub-title {
158+
font-weight: 700;
159+
font-size: 0.82em;
160+
margin-bottom: 5px;
161+
color: #333;
162+
}
163+
164+
/* Single-line status readout */
165+
.ds-status {
166+
font-size: 0.72em !important;
167+
color: #555;
168+
background: #f0f0f0;
169+
border: 1px solid #ddd;
170+
margin-bottom: 0;
171+
}

0 commit comments

Comments
 (0)