@digitalbazaar/eddsa-rdfc-2022-cryptosuite 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/canonize.js +14 -5
- package/package.json +6 -5
package/lib/canonize.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
|
|
2
|
+
* Copyright (c) 2023-2024 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
+
import * as rdfCanonize from 'rdf-canonize';
|
|
4
5
|
import jsonld from 'jsonld';
|
|
5
6
|
|
|
6
|
-
export function canonize(input, options) {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export async function canonize(input, options) {
|
|
8
|
+
// convert to RDF dataset and do canonicalization
|
|
9
|
+
options = {
|
|
10
|
+
algorithm: 'RDFC-1.0',
|
|
9
11
|
format: 'application/n-quads',
|
|
12
|
+
base: null,
|
|
13
|
+
safe: true,
|
|
10
14
|
...options
|
|
11
|
-
}
|
|
15
|
+
};
|
|
16
|
+
const opts = {...options, produceGeneralizedRdf: false};
|
|
17
|
+
delete opts.format;
|
|
18
|
+
opts.produceGeneralizedRdf = false;
|
|
19
|
+
const dataset = await jsonld.toRDF(input, opts);
|
|
20
|
+
return rdfCanonize.canonize(dataset, options);
|
|
12
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalbazaar/eddsa-rdfc-2022-cryptosuite",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "An EdDSA-RDFC-2022 Data Integrity cryptosuite for use with jsonld-signatures.",
|
|
5
5
|
"homepage": "https://github.com/digitalbazaar/eddsa-rdfc-2022-cryptosuite",
|
|
6
6
|
"repository": {
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@digitalbazaar/ed25519-multikey": "^1.0.0",
|
|
18
|
-
"jsonld": "^8.1.0"
|
|
18
|
+
"jsonld": "^8.1.0",
|
|
19
|
+
"rdf-canonize": "^4.0.1"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
|
-
"@digitalbazaar/ed25519-verification-key-2018": "^4.0.0",
|
|
22
|
-
"@digitalbazaar/ed25519-verification-key-2020": "^4.1.0",
|
|
23
22
|
"@digitalbazaar/data-integrity": "^2.0.0",
|
|
24
23
|
"@digitalbazaar/data-integrity-context": "^2.0.0",
|
|
25
24
|
"@digitalbazaar/ed25519-multikey": "^1.0.0",
|
|
26
|
-
"@digitalbazaar/
|
|
25
|
+
"@digitalbazaar/ed25519-verification-key-2018": "^4.0.0",
|
|
26
|
+
"@digitalbazaar/ed25519-verification-key-2020": "^4.1.0",
|
|
27
|
+
"@digitalbazaar/multikey-context": "^2.0.1",
|
|
27
28
|
"@digitalbazaar/security-document-loader": "^2.0.0",
|
|
28
29
|
"c8": "^7.11.3",
|
|
29
30
|
"chai": "^4.3.6",
|