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

XML error #46

Open
Hellomik2002 opened this issue Jul 8, 2020 · 1 comment
Open

XML error #46

Hellomik2002 opened this issue Jul 8, 2020 · 1 comment
Assignees

Comments

@Hellomik2002
Copy link

I installed webcrypto with npm by but still have issue when I try new XmlDSigJs.SignedXml().Sign(...)

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 (C:\\projects\\notr\\node_modules\\xml-core\\dist\\index.js:216:22)\n' +
    '    at Function.get crypto [as crypto] (C:\\projects\\notr\\node_modules\\xmldsigjs\\build\\index.js:22:19)\n' +
    '    at RsaKeyValue.importKey (C:\\projects\\notr\\node_modules\\xmldsigjs\\build\\index.js:1539:39)\n' +
    '    at KeyValue.importKey (C:\\projects\\notr\\node_modules\\xmldsigjs\\build\\index.js:1710:34)\n' +
    '    at SignedXml.ApplySignOptions (C:\\projects\\notr\\node_modules\\xmldsigjs\\build\\index.js:2656:28)\n' +
    '    at SignedXml.Sign (C:\\projects\\notr\\node_modules\\xmldsigjs\\build\\index.js:2360:20)\n' +
    '    at C:\\projects\\notr\\cryptXML.js:59:22'
}
@SmartLayer
Copy link

SmartLayer commented Jul 8, 2020

You might have fallen into the same trap I did a while ago. First, if you do npm install webcrypto it doesn't provide WebCrypto. Then, the 3 libraries that do are listed in this post by me and I think the only one that works with xmldsigjs is webcrypto-ossl. (That post has now other libraries failed to work with xmldsigjs.) Even worse, these libraries have different initialisation methods so one can't serve as the drop-in replacement of another without tweak.

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

3 participants