Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run example https://github.com/PeculiarVentures/xadesjs/issues/84 but it produces an error message: 'XMLJS0014: WebCrypto module is not found' #128

Open
Jairos2015 opened this issue Dec 5, 2022 · 1 comment

Comments

@Jairos2015
Copy link

I run example (I created an example for adding multiple signing certificates: Microshine) #84 but it produces an error

message: 'XMLJS0014: WebCrypto module is not found'

node:internal/process/esm_loader:91
internalBinding('errors').triggerUncaughtException(
^
XmlError {
prefix: 'XMLJS',
code: 14,
name: 'XmlError',
message: 'XMLJS0014: WebCrypto module is not found',
stack: 'Error: XMLJS0014: WebCrypto module is not found\n' +
' at new XmlError (D:\nodejs\xadescert\node_modules\xml-core\dist\index.js:217:22)\n' +
' at get crypto [as crypto] (D:\nodejs\xadescert\node_modules\xmldsigjs\build\index.js:40:19)\n' +
' at SignedXml.CreateQualifyingProperties (D:\nodejs\xadescert\node_modules\xadesjs\build\index.js:1676:54)\n' +
' at new SignedXml (D:\nodejs\xadescert\node_modules\xadesjs\build\index.js:1634:14)\n' +
' at file:///D:/nodejs/xadescert/index.js:27:19'
}

Node.js v18.4.0

Please help me.

Packages used:
import * as xmldsig from "xmldsigjs";
import { Crypto } from "@peculiar/webcrypto";
import * as x509 from "@peculiar/x509";
import * as xmldom from "xmldom";
import * as xades from "xadesjs";

const crypto = new Crypto();
x509.cryptoProvider.set(crypto);

@tjomk
Copy link

tjomk commented Sep 3, 2024

import { Crypto as WebCrypto } from '@peculiar/webcrypto';
import * as xadesjs from 'xadesjs';

xadesjs.Application.setEngine('NodeJS', new WebCrypto());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants