@joclaim/tls 0.1.0 → 0.2.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/crypto/webcrypto.js +4 -1
- package/package.json +1 -1
package/lib/crypto/webcrypto.js
CHANGED
|
@@ -2,7 +2,10 @@ import { cbc as aesCbc } from '@noble/ciphers/aes';
|
|
|
2
2
|
import { chacha20poly1305 } from '@noble/ciphers/chacha';
|
|
3
3
|
import { ECDSASigValue } from '@peculiar/asn1-ecc';
|
|
4
4
|
import { AsnParser } from '@peculiar/asn1-schema';
|
|
5
|
-
|
|
5
|
+
// use globalThis.crypto for cross-environment compatibility
|
|
6
|
+
// works in browsers natively and in Node.js 19+
|
|
7
|
+
// eslint-disable-next-line
|
|
8
|
+
const webcrypto = globalThis.crypto;
|
|
6
9
|
import { PKCS1_KEM } from 'micro-rsa-dsa-dh/rsa.js';
|
|
7
10
|
import { asciiToUint8Array, concatenateUint8Arrays } from "../utils/generics.js";
|
|
8
11
|
import { parseRsaPublicKeyFromAsn1 } from "./common.js";
|