Skip to content

Commit e82927c

Browse files
author
Weiwu Zhang
committed
adding the index.js which was forgotten earlier.
1 parent ffae90c commit e82927c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

xmldsig/js/src/index.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use strict";
2+
3+
//const crypto = require('crypto').webcrypto;
4+
import crypto from 'crypto';
5+
import XmlDSigJs from "xmldsigjs";
6+
XmlDSigJs.Application.setEngine("WebCrypto", crypto.webcrypto);
7+
8+
export default function verify(xml_string) {
9+
let doc = XmlDSigJs.Parse(xml_string);
10+
let signature = doc.getElementsByTagNameNS("http://www.w3.org/2000/09/xmldsig#", "Signature");
11+
12+
let signedXml = new XmlDSigJs.SignedXml(doc);
13+
signedXml.LoadXml(signature[0]);
14+
15+
return signedXml.Verify()
16+
}
17+

0 commit comments

Comments
 (0)