Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
OR13 committed Jan 27, 2024
1 parent d8350c6 commit c545bf1
Show file tree
Hide file tree
Showing 5 changed files with 798 additions and 13 deletions.
37 changes: 37 additions & 0 deletions scripts/make-iana-cose-algorithms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

const axios = require('axios');
const fs = require('fs');
const csv = require('csv-parser');

const iana = 'https://www.iana.org/assignments/cose/algorithms.csv';

(async () => {
const response = await axios.get(iana, {
// headers: {Authorization: `Bearer ${token}`,
responseType: 'stream'
});
const stream = response.data.pipe(csv());
const IANACOSEAlgorithms = {}
stream.on('data', row => {
if (row.Reference.startsWith('[RFC')) {
row.Reference = `https://datatracker.ietf.org/doc/${row.Reference.substring(1, row.Reference.length - 1)}`
}
IANACOSEAlgorithms[row.Value] = row
});
stream.on('end', () => {
const file = `
export type IANACOSEAlgorithm = {
Name: string
Value: string
Description: string
Capabilities: string
'Change Controller': string
Recommended: string
Reference: string
}
export const IANACOSEHeaderParameters: Record<string, IANACOSEAlgorithm> = ${JSON.stringify(IANACOSEAlgorithms, null, 2)};
`
fs.writeFileSync('./src/cose/alg.ts', file.trim())
});
})()
6 changes: 4 additions & 2 deletions src/__fixtures__/ecdsa-examples/ecdsa-sig-02.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

.edn-cose-sign1 { font-family: monospace; }
.edn-cose-sign1 * { margin: 0; padding: 0; }
.edn-cose-sign1 dt { padding-right: 8px;}
.edn-cose-sign1 dt, dd { display: inline-block; padding-left: 8px; }
.edn-cose-sign1 ol li {
list-style: none;
padding-left: 8px;
}
.decoded-nested { margin: 8px }

</style>

Expand All @@ -19,8 +21,8 @@
])


<section>
{<dl><dt>/ alg / 1 : </dt><dd>-35</dd><dl>}
<section class="decoded-nested">
/ protected / {<dl><dt>/ alg / 1 : </dt><dd>/ ES384 / -35 </dd><dl>}
</section>


Expand Down
Loading

0 comments on commit c545bf1

Please sign in to comment.