Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git://github.com/yaronn/xml-crypto

  • Loading branch information...
commit 4e3a69ed1d79512fcb181e5afeb8a871f088c6ed 2 parents 0c47f01 + 6f08e97
@woloski woloski authored
View
5 README.md
@@ -1,7 +1,7 @@
## xml-crypto
An xml digital signature library for node. Xml encryption is coming soon. Written is pure javascript!
-For more information visit [my blog](http://webservices20.blogspot.com/).
+For more information visit [my blog](http://webservices20.blogspot.com/) or [my twitter](https://twitter.com/YaronNaveh).
## Install
Install with [npm](http://github.com/isaacs/npm):
@@ -14,8 +14,7 @@ A pre requisite it to have [openssl](http://www.openssl.org/) installed and its
Use this code:
`````javascript
- var SignedXml = require('xml-crypto').SignedXml
- , FileKeyInfo = require('xml-crypto').FileKeyInfo
+ var SignedXml = require('xml-crypto').SignedXml
, fs = require('fs')
var xml = "<library>" +
View
2  lib/enveloped-signature.js
@@ -6,7 +6,7 @@ function EnvelopedSignature() {
}
EnvelopedSignature.prototype.process = function (node) {
- var signature = xpath.SelectNodes(node.ownerDocument, "/*/*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']")[0];
+ var signature = xpath.SelectNodes(node.ownerDocument, "//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']")[0];
if (signature) signature.parentNode.removeChild(signature)
return node.toString();
};
View
6 package.json
@@ -1,11 +1,11 @@
{
"name": "xml-crypto",
- "version": "0.0.6",
+ "version": "0.0.9",
"description": "Xml digital signature and encryption library for Node.js",
"engines": { "node": ">=0.4.0" },
"author": "Yaron Naveh (yaronn01@gmail.com, http://webservices20.blogspot.com/)",
"dependencies": {
- "xmldom": ">=0.1.8"
+ "xmldom": ">=0.1.8"
},
"devDependencies": {
"nodeunit": ">=0.6.4"
@@ -20,6 +20,6 @@
"type" : "MIT License",
"url" : "http://www.opensource.org/licenses/mit-license.php" }],
"scripts": {
- "test": "./node_modules/nodeunit/bin/nodeunit test"
+ "test": "nodeunit ./test/canonicalization-unit-tests.js ./test/signature-unit-tests.js ./test/saml-response-test.js ./test/signature-integration-tests.js"
}
}
View
2  test/signature-integration-tests.js
@@ -21,7 +21,7 @@ module.exports = {
"<firstName>Joanne K</firstName>" +
"<lastName>Rowling</lastName>" +
"</author>" +
- "</book>"
+ "</book>" +
"</library>"
verifySignature(test, xml, ["//*[local-name(.)='book']"])
View
11 test/xml-assert.js
@@ -0,0 +1,11 @@
+var select = require('../lib/xpath.js').SelectNodes
+ , dom = require('xmldom').DOMParser
+
+
+function nodeExists(test, doc, xpath) {
+ if (!doc && !xpath) return
+ var node = select(doc, xpath)
+ test.ok(node.length==1, "xpath " + xpath + " not found")
+}
+
+exports.nodeExists = nodeExists
Please sign in to comment.
Something went wrong with that request. Please try again.