@digitalcredentials/jsonld-signatures
Advanced tools
Comparing version 11.0.0 to 12.0.0
/* | ||
* Copyright (c) 2025 Digital Credentials Consortium - React Native addition. | ||
* Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. | ||
@@ -6,3 +7,3 @@ */ | ||
const crypto = require('@sphereon/isomorphic-webcrypto'); | ||
import * as Crypto from 'expo-crypto'; | ||
require('fast-text-encoding'); | ||
@@ -21,5 +22,4 @@ | ||
return new Uint8Array( | ||
await crypto.subtle.digest({name: 'SHA-256'}, bytes) | ||
); | ||
await Crypto.digest(Crypto.CryptoDigestAlgorithm.SHA256, bytes)); | ||
} | ||
}; |
{ | ||
"name": "@digitalcredentials/jsonld-signatures", | ||
"version": "11.0.0", | ||
"version": "12.0.0", | ||
"description": "An implementation of the Linked Data Signatures specifications for JSON-LD in JavaScript.", | ||
@@ -19,3 +19,2 @@ "homepage": "https://github.com/digitalcredentials/jsonld-signatures", | ||
"@digitalbazaar/security-context": "^1.0.0", | ||
"@sphereon/isomorphic-webcrypto": "^2.5.0-unstable.0", | ||
"fast-text-encoding": "^1.0.3", | ||
@@ -71,4 +70,5 @@ "serialize-error": "^8.0.1" | ||
"./lib/sha256digest.js": "./lib/sha256digest-browser.js", | ||
"./lib/sha256digest-reactnative.js": false, | ||
"fast-text-encoding": false, | ||
"@sphereon/isomorphic-webcrypto": false | ||
"expo-crypto": false | ||
}, | ||
@@ -75,0 +75,0 @@ "react-native": { |
@@ -17,19 +17,5 @@ # JSON-LD Signatures _(@digitalcredentials/jsonld-signatures)_ | ||
## Version Compatibility | ||
(Forked from [`jsonld-signatures` v9.0.0](https://github.com/digitalbazaar/jsonld-signatures) | ||
to provide TypeScript compatibility.) | ||
to provide TypeScript, Jest, and React Native compatibility.) | ||
`jsonld-signatures` **v9.0** is compatible with the following signature suites: | ||
* [`ed25519-signature-2020`](https://github.com/digitalcredentials/ed25519-signature-2020) | ||
`>= 2.1.0`. | ||
and the following related libraries: | ||
* `crypto-ld` `>= 5.0.0` (and related key crypto suites such as | ||
[`ed25519-verification-key-2020`](https://github.com/digitalbazaar/ed25519-verification-key-2020) | ||
`>= 2.1.0`). | ||
* `@digitalcredentials/vc` `>= 1.0` | ||
## Background | ||
@@ -65,3 +51,3 @@ | ||
working with those, you should use a higher-level library that's specifically | ||
made for that purpose, such as [`@digitalcredentials/vc`](https://github.com/digitalcredentials/vc-js). | ||
made for that purpose, such as [`@digitalcredentials/vc`](https://github.com/digitalcredentials/vc). | ||
(Incidentally, `vc-js` uses this library, `jsonld-signatures`, under the hood.) | ||
@@ -116,3 +102,18 @@ | ||
`jsonld-signatures` (version `8.x` and above) is not meant for standalone use. | ||
### React Native Usage | ||
This library depends on `expo-crypto` when used inside React Native projects. | ||
That means you must add `expo-crypto` to your project's dependencies. | ||
Sample `package.json`: | ||
``` | ||
"dependencies": { | ||
"expo-crypto": "~12.8.0" | ||
} | ||
``` | ||
### Node.js and Browser Usage | ||
`jsonld-signatures` (version `12.x` and above) is not meant for standalone use. | ||
Instead, it's generally used through an individual _crypto suite_. | ||
@@ -143,9 +144,2 @@ For detailed usage instructions, see the READMEs of the supported suites: | ||
### Node.js Native Canonize Bindings | ||
Specialized use cases may wish to use the native canonize bindings. This mode | ||
can be enabled by setting the `useNativeCanonize` option to `true`. See the | ||
[jsonld.js notes](https://github.com/digitalbazaar/jsonld.js#nodejs-native-canonize-bindings) | ||
on this feature and note you should benchmark performance before using it. | ||
## Contribute | ||
@@ -152,0 +146,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
63823
154
- Removed@peculiar/asn1-schema@2.3.15(transitive)
- Removed@peculiar/json-schema@1.1.12(transitive)
- Removed@peculiar/webcrypto@1.5.0(transitive)
- Removed@sphereon/isomorphic-webcrypto@2.5.0-unstable.0(transitive)
- Removedasmcrypto.js@2.3.2(transitive)
- Removedasn1js@3.0.5(transitive)
- Removedb64-lite@1.4.0(transitive)
- Removedb64u-lite@1.1.0(transitive)
- Removedbase-64@0.1.0(transitive)
- Removedcipher-base@1.0.6(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedhash-base@3.1.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedmsrcrypto@1.5.8(transitive)
- Removedpvtsutils@1.3.6(transitive)
- Removedpvutils@1.1.3(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedrandomfill@1.0.4(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedstr2buf@1.3.0(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedtslib@2.8.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwebcrypto-core@1.8.1(transitive)
- Removedwebcrypto-shim@0.1.7(transitive)