xmlsig 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +0 -0
- data/ext/xmlsig/BioWrap.h +98 -0
- data/ext/xmlsig/DSig.cpp +109 -0
- data/ext/xmlsig/DSig.h +81 -0
- data/ext/xmlsig/DSigCtx.h +72 -0
- data/ext/xmlsig/Exceptions.cpp +151 -0
- data/ext/xmlsig/Exceptions.h +214 -0
- data/ext/xmlsig/Key.cpp +582 -0
- data/ext/xmlsig/Key.h +338 -0
- data/ext/xmlsig/KeyInfoCtx.h +67 -0
- data/ext/xmlsig/KeyStore.cpp +180 -0
- data/ext/xmlsig/KeyStore.h +157 -0
- data/ext/xmlsig/KeysMngrWrap.h +62 -0
- data/ext/xmlsig/NodeSet.h +60 -0
- data/ext/xmlsig/Signer.cpp +691 -0
- data/ext/xmlsig/Signer.h +373 -0
- data/ext/xmlsig/TrustVerifier.cpp +145 -0
- data/ext/xmlsig/TrustVerifier.h +174 -0
- data/ext/xmlsig/Verifier.cpp +677 -0
- data/ext/xmlsig/Verifier.h +313 -0
- data/ext/xmlsig/X509Certificate.cpp +362 -0
- data/ext/xmlsig/X509Certificate.h +146 -0
- data/ext/xmlsig/XPath.cpp +173 -0
- data/ext/xmlsig/XPath.h +156 -0
- data/ext/xmlsig/XPathCtx.h +68 -0
- data/ext/xmlsig/XmlCharBuf.h +60 -0
- data/ext/xmlsig/XmlDoc.cpp +278 -0
- data/ext/xmlsig/XmlDoc.h +157 -0
- data/ext/xmlsig/XmlElement.cpp +151 -0
- data/ext/xmlsig/XmlElement.h +134 -0
- data/ext/xmlsig/countptr.h +260 -0
- data/ext/xmlsig/extconf.rb +58 -0
- data/ext/xmlsig/runtests.rb +23 -0
- data/ext/xmlsig/swig/countptr.i +27 -0
- data/ext/xmlsig/swig/exceptions.i +79 -0
- data/ext/xmlsig/swig/ruby.i +17 -0
- data/ext/xmlsig/swig/xmlsig.i +405 -0
- data/ext/xmlsig/t/tc_cert.rb +34 -0
- data/ext/xmlsig/t/tc_interface.rb +158 -0
- data/ext/xmlsig/t/tc_signer.rb +501 -0
- data/ext/xmlsig/t/tc_tsik.rb +490 -0
- data/ext/xmlsig/t/tc_verifier.rb +151 -0
- data/ext/xmlsig/t/tsik_interop/sign.rb +48 -0
- data/ext/xmlsig/t/tsik_interop/verify.rb +31 -0
- data/ext/xmlsig/t/tsik_interop/verify_own.rb +46 -0
- data/ext/xmlsig/xmlsig.cpp +13363 -0
- data/lib/xmlsig.rb +1 -0
- metadata +113 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'xmlsig'
|
3
|
+
|
4
|
+
in_path = '../res/tsik/in/'
|
5
|
+
key_path = '../res/tsik/keys/'
|
6
|
+
|
7
|
+
x = Xmlsig::XmlDoc.new
|
8
|
+
x.loadFromFile(in_path + "out.xml")
|
9
|
+
xp = Xmlsig::XPath.new()
|
10
|
+
xp.addNamespace('ds', 'http://www.w3.org/2000/09/xmldsig#')
|
11
|
+
xp.setXPath('/descendant::ds:Signature[position()=1]')
|
12
|
+
v = Xmlsig::Verifier.new(x,xp)
|
13
|
+
puts "error in #1" if (v.verify != 1)
|
14
|
+
|
15
|
+
x = Xmlsig::XmlDoc.new
|
16
|
+
x.loadFromFile(in_path + "cert_only_out.xml")
|
17
|
+
xp = Xmlsig::XPath.new()
|
18
|
+
xp.addNamespace('ds', 'http://www.w3.org/2000/09/xmldsig#')
|
19
|
+
xp.setXPath('/descendant::ds:Signature[position()=1]')
|
20
|
+
v = Xmlsig::Verifier.new(x,xp)
|
21
|
+
ks = Xmlsig::KeyStore.new
|
22
|
+
ks.addTrustedCertFromFile(key_path + 'root.cer', 'cert_der')
|
23
|
+
ks.addTrustedCertFromFile(key_path + 'ca.cer', 'cert_der')
|
24
|
+
v.setKeyStore(ks)
|
25
|
+
puts "error in #2" if (v.verify != 1)
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'xmlsig'
|
3
|
+
|
4
|
+
key_path = '../res/tsik/keys/'
|
5
|
+
out_path = '../'
|
6
|
+
|
7
|
+
x = Xmlsig::XmlDoc.new
|
8
|
+
x.loadFromFile(out_path + "out_1.xml")
|
9
|
+
xp = Xmlsig::XPath.new()
|
10
|
+
xp.addNamespace('ds', 'http://www.w3.org/2000/09/xmldsig#')
|
11
|
+
xp.setXPath('/descendant::ds:Signature[position()=1]')
|
12
|
+
v = Xmlsig::Verifier.new(x,xp)
|
13
|
+
vk = Xmlsig::Key.new
|
14
|
+
vk.loadFromFile(key_path + 'Alice.cer','cert_der','')
|
15
|
+
puts "error in #1" if (v.verify(vk) != 1)
|
16
|
+
|
17
|
+
|
18
|
+
x = Xmlsig::XmlDoc.new
|
19
|
+
x.loadFromFile(out_path + "out_2.xml")
|
20
|
+
xp = Xmlsig::XPath.new()
|
21
|
+
xp.addNamespace('ds', 'http://www.w3.org/2000/09/xmldsig#')
|
22
|
+
xp.setXPath('/descendant::ds:Signature[position()=1]')
|
23
|
+
v = Xmlsig::Verifier.new(x,xp)
|
24
|
+
ks = Xmlsig::KeyStore.new
|
25
|
+
ks.addTrustedCertFromFile(key_path + 'root.cer', 'cert_der')
|
26
|
+
ks.addTrustedCertFromFile(key_path + 'ca.cer', 'cert_der')
|
27
|
+
v.setKeyStore(ks)
|
28
|
+
puts "error in #2" if (v.verify != 1)
|
29
|
+
|
30
|
+
|
31
|
+
x = Xmlsig::XmlDoc.new
|
32
|
+
x.loadFromFile(out_path + "out_3.xml")
|
33
|
+
xp = Xmlsig::XPath.new()
|
34
|
+
xp.addNamespace('ds', 'http://www.w3.org/2000/09/xmldsig#')
|
35
|
+
xp.setXPath('/descendant::ds:Signature[position()=1]')
|
36
|
+
v = Xmlsig::Verifier.new(x,xp)
|
37
|
+
ks = Xmlsig::KeyStore.new
|
38
|
+
ks.addTrustedCertFromFile(key_path + 'root.cer', 'cert_der')
|
39
|
+
ks.addTrustedCertFromFile(key_path + 'ca.cer', 'cert_der')
|
40
|
+
v.setKeyStore(ks)
|
41
|
+
puts "error in #3" if (v.verify != 1)
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|