xml-crypto- XML 数据签名和加密
JavaScript XML相关工具
访问GitHub主页
共0Star
详细介绍
xml-crypto 是一个 Node.js 的扩展用来实现对 XML
数据签名和加密。
示例代码:
var SignedXml = require('xml-crypto').SignedXml
, FileKeyInfo = require('xml-crypto').FileKeyInfo
, fs = require('fs')
var xml = "<library>" +
"<book>" +
"<name>Harry Potter</name>" +
"</book>"
"</library>"
var sig = new SignedXml()
sig.addReference("//*[local-name(.)='book']")
sig.signingKey = fs.readFileSync("client.pem")
sig.computeSignature(xml)
fs.writeFileSync("signed.xml", sig.getSignedXml())
推荐源码
暂无源码 更多源码...