xmlsec 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/README.md +4 -0
- data/Rakefile +4 -0
- data/ext/xmlsec/Makefile +213 -0
- data/ext/xmlsec/extconf.rb +7 -0
- data/ext/xmlsec/mkmf.log +5 -0
- data/ext/xmlsec/sign.c +174 -0
- data/ext/xmlsec/sign.h +9 -0
- data/ext/xmlsec/sign.o +0 -0
- data/ext/xmlsec/verify.c +212 -0
- data/ext/xmlsec/verify.h +7 -0
- data/ext/xmlsec/verify.o +0 -0
- data/ext/xmlsec/xmlsec_ext.c +75 -0
- data/ext/xmlsec/xmlsec_ext.h +29 -0
- data/ext/xmlsec/xmlsec_ext.o +0 -0
- data/ext/xmlsec/xmlsec_ext.so +0 -0
- data/lib/xmlsec.rb +9 -0
- data/lib/xmlsec/error.rb +5 -0
- data/lib/xmlsec/version.rb +3 -0
- data/spec/assets/csr.pem +11 -0
- data/spec/assets/private.key.pem +15 -0
- data/spec/assets/private.passw.key.pem +18 -0
- data/spec/assets/public.key.pem +6 -0
- data/spec/assets/signed.test.xml +44 -0
- data/spec/assets/unsigned.test.xml +14 -0
- data/spec/assets/x509.crt +13 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/xmlsec/sign_spec.rb +320 -0
- data/spec/xmlsec/verify_spec.rb +46 -0
- data/tasks/rspec.rake +16 -0
- data/xmlsec.gemspec +28 -0
- metadata +132 -0
data/ext/xmlsec/sign.o
ADDED
Binary file
|
data/ext/xmlsec/verify.c
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
#include <xmlsec_ext.h>
|
2
|
+
#include <verify.h>
|
3
|
+
#include <errno.h>
|
4
|
+
|
5
|
+
extern VALUE mXmlSec, cXmlSecError;
|
6
|
+
|
7
|
+
VALUE xmlsec_is_valid_by_x509_file(VALUE self, xmlDocPtr doc, VALUE x509_file ) {
|
8
|
+
xmlSecKeysMngrPtr mngr;
|
9
|
+
xmlNodePtr node = NULL;
|
10
|
+
xmlSecDSigCtxPtr dsigCtx = NULL;
|
11
|
+
|
12
|
+
mngr = xmlSecKeysMngrCreate();
|
13
|
+
|
14
|
+
if(mngr == NULL) {
|
15
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
16
|
+
rb_raise(rb_eRuntimeError, "Error: failed to create keys manager.\n");
|
17
|
+
return Qnil;
|
18
|
+
}
|
19
|
+
|
20
|
+
if(xmlSecCryptoAppDefaultKeysMngrInit(mngr) < 0) {
|
21
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
22
|
+
if(mngr != NULL) xmlSecKeysMngrDestroy(mngr);
|
23
|
+
rb_raise(rb_eRuntimeError, "Error: failed to initialize keys manager.\n");
|
24
|
+
return Qnil;
|
25
|
+
}
|
26
|
+
|
27
|
+
/* load trusted cert */
|
28
|
+
if(xmlSecCryptoAppKeysMngrCertLoad(mngr, StringValuePtr(x509_file), xmlSecKeyDataFormatPem, xmlSecKeyDataTypeTrusted) < 0) {
|
29
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
30
|
+
if(mngr != NULL) xmlSecKeysMngrDestroy(mngr);
|
31
|
+
rb_raise(rb_eRuntimeError, "Error: failed to load pem certificate from \"%s\"\n", StringValuePtr(x509_file));
|
32
|
+
return Qnil;
|
33
|
+
}
|
34
|
+
|
35
|
+
/* find start node */
|
36
|
+
node = xmlSecFindNode(xmlDocGetRootElement(doc), xmlSecNodeSignature, xmlSecDSigNs);
|
37
|
+
if(node == NULL) {
|
38
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
39
|
+
rb_raise(rb_eRuntimeError, "Error: start node not found\n");
|
40
|
+
return Qnil;
|
41
|
+
}
|
42
|
+
|
43
|
+
/* create signature context*/
|
44
|
+
dsigCtx = xmlSecDSigCtxCreate(mngr);
|
45
|
+
if(dsigCtx == NULL) {
|
46
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
47
|
+
if(mngr != NULL) xmlSecKeysMngrDestroy(mngr);
|
48
|
+
rb_raise(rb_eRuntimeError, "Error: failed to create signature context\n");
|
49
|
+
return Qnil;
|
50
|
+
}
|
51
|
+
|
52
|
+
/* Verify signature */
|
53
|
+
if(xmlSecDSigCtxVerify(dsigCtx, node) < 0) {
|
54
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
55
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
56
|
+
if(mngr != NULL) xmlSecKeysMngrDestroy(mngr);
|
57
|
+
rb_raise(rb_eRuntimeError, "Error: signature verify \"%s\"\n");
|
58
|
+
return Qnil;
|
59
|
+
}
|
60
|
+
|
61
|
+
/* verification result*/
|
62
|
+
if(dsigCtx->status == xmlSecDSigStatusSucceeded) {
|
63
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
64
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
65
|
+
if(mngr != NULL) xmlSecKeysMngrDestroy(mngr);
|
66
|
+
return Qtrue;
|
67
|
+
} else {
|
68
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
69
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
70
|
+
if(mngr != NULL) xmlSecKeysMngrDestroy(mngr);
|
71
|
+
return Qfalse;
|
72
|
+
}
|
73
|
+
|
74
|
+
}
|
75
|
+
|
76
|
+
VALUE xmlsec_is_valid(VALUE self, xmlDocPtr doc) {
|
77
|
+
xmlNodePtr node = NULL;
|
78
|
+
xmlSecDSigCtxPtr dsigCtx = NULL;
|
79
|
+
|
80
|
+
/* find start node */
|
81
|
+
node = xmlSecFindNode(xmlDocGetRootElement(doc), xmlSecNodeSignature, xmlSecDSigNs);
|
82
|
+
if(node == NULL) {
|
83
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
84
|
+
rb_raise(rb_eRuntimeError, "Error: start node not found\n");
|
85
|
+
return Qnil;
|
86
|
+
}
|
87
|
+
|
88
|
+
/* create signature context*/
|
89
|
+
dsigCtx = xmlSecDSigCtxCreate(NULL);
|
90
|
+
if(dsigCtx == NULL) {
|
91
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
92
|
+
rb_raise(rb_eRuntimeError, "Error: failed to create signature context\n");
|
93
|
+
return Qnil;
|
94
|
+
}
|
95
|
+
|
96
|
+
/* Verify signature */
|
97
|
+
if(xmlSecDSigCtxVerify(dsigCtx, node) < 0) {
|
98
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
99
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
100
|
+
rb_raise(rb_eRuntimeError, "Error: signature verify \"%s\"\n");
|
101
|
+
return Qnil;
|
102
|
+
}
|
103
|
+
|
104
|
+
/* verification result*/
|
105
|
+
if(dsigCtx->status == xmlSecDSigStatusSucceeded) {
|
106
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
107
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
108
|
+
return Qtrue;
|
109
|
+
} else {
|
110
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
111
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
112
|
+
return Qfalse;
|
113
|
+
}
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
VALUE xmlsec_is_valid_by_key(VALUE self, xmlDocPtr doc, VALUE key_file ) {
|
118
|
+
xmlNodePtr node = NULL;
|
119
|
+
xmlSecDSigCtxPtr dsigCtx = NULL;
|
120
|
+
|
121
|
+
/* find start node */
|
122
|
+
node = xmlSecFindNode(xmlDocGetRootElement(doc), xmlSecNodeSignature, xmlSecDSigNs);
|
123
|
+
if(node == NULL) {
|
124
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
125
|
+
rb_raise(rb_eRuntimeError, "Error: start node not found\n");
|
126
|
+
return Qnil;
|
127
|
+
}
|
128
|
+
|
129
|
+
/* create signature context*/
|
130
|
+
dsigCtx = xmlSecDSigCtxCreate(NULL);
|
131
|
+
if(dsigCtx == NULL) {
|
132
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
133
|
+
rb_raise(rb_eRuntimeError, "Error: failed to create signature context\n");
|
134
|
+
return Qnil;
|
135
|
+
}
|
136
|
+
|
137
|
+
/* load public key */
|
138
|
+
dsigCtx->signKey = xmlSecCryptoAppKeyLoad(StringValuePtr(key_file), xmlSecKeyDataFormatPem, NULL, NULL, NULL);
|
139
|
+
if(dsigCtx->signKey == NULL) {
|
140
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
141
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
142
|
+
rb_raise(rb_eRuntimeError, "Error: failed to load public pem key from \"%s\"\n", StringValuePtr(key_file));
|
143
|
+
return Qnil;
|
144
|
+
}
|
145
|
+
|
146
|
+
/* set key name to the file name*/
|
147
|
+
if(xmlSecKeySetName(dsigCtx->signKey, StringValuePtr(key_file)) < 0) {
|
148
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
149
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
150
|
+
rb_raise(rb_eRuntimeError, "Error: failed to set key name for key from \"%s\"\n", StringValuePtr(key_file));
|
151
|
+
return Qnil;
|
152
|
+
}
|
153
|
+
|
154
|
+
/* Verify signature */
|
155
|
+
if(xmlSecDSigCtxVerify(dsigCtx, node) < 0) {
|
156
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
157
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
158
|
+
rb_raise(rb_eRuntimeError, "Error: signature verify \"%s\"\n");
|
159
|
+
return Qnil;
|
160
|
+
}
|
161
|
+
|
162
|
+
/* verification result*/
|
163
|
+
if(dsigCtx->status == xmlSecDSigStatusSucceeded) {
|
164
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
165
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
166
|
+
return Qtrue;
|
167
|
+
} else {
|
168
|
+
if(dsigCtx != NULL) xmlSecDSigCtxDestroy(dsigCtx);
|
169
|
+
if(doc != NULL) xmlFreeDoc(doc);
|
170
|
+
return Qfalse;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
|
174
|
+
static VALUE rb_xmlsec_is_valid_file(VALUE self, VALUE template_file, VALUE key_file, VALUE x509_file ) {
|
175
|
+
xmlDocPtr doc;
|
176
|
+
|
177
|
+
doc = xmlParseFile(StringValuePtr(template_file));
|
178
|
+
|
179
|
+
if ((doc == NULL) || (xmlDocGetRootElement(doc) == NULL)) {
|
180
|
+
rb_raise(rb_eRuntimeError, "Error: unable to parse template file.");
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
if (! NIL_P(x509_file)) return xmlsec_is_valid_by_x509_file(self, doc, x509_file );
|
184
|
+
if (! NIL_P(key_file)) return xmlsec_is_valid_by_key(self, doc, key_file);
|
185
|
+
return xmlsec_is_valid(self, doc);
|
186
|
+
}
|
187
|
+
|
188
|
+
static VALUE rb_xmlsec_is_valid(VALUE self, VALUE template, VALUE key_file, VALUE x509_file ) {
|
189
|
+
xmlDocPtr doc;
|
190
|
+
doc = xmlReadMemory(
|
191
|
+
StringValuePtr(template),
|
192
|
+
RSTRING_LEN(template),
|
193
|
+
"noname.xml",
|
194
|
+
NULL,
|
195
|
+
0
|
196
|
+
);
|
197
|
+
if ((doc == NULL) || (xmlDocGetRootElement(doc) == NULL)){
|
198
|
+
rb_raise(rb_eRuntimeError, "Error: unable to parse template.");
|
199
|
+
return;
|
200
|
+
}
|
201
|
+
if (! NIL_P(x509_file)) return xmlsec_is_valid_by_x509_file(self, doc, x509_file );
|
202
|
+
if (! NIL_P(key_file)) return xmlsec_is_valid_by_key(self, doc, key_file);
|
203
|
+
return xmlsec_is_valid(self, doc);
|
204
|
+
}
|
205
|
+
|
206
|
+
|
207
|
+
void init_xmlsec_verify(){
|
208
|
+
|
209
|
+
rb_define_singleton_method(mXmlSec, "valid_file?", rb_xmlsec_is_valid_file, 3);
|
210
|
+
rb_define_singleton_method(mXmlSec, "valid?", rb_xmlsec_is_valid, 3);
|
211
|
+
|
212
|
+
}
|
data/ext/xmlsec/verify.h
ADDED
data/ext/xmlsec/verify.o
ADDED
Binary file
|
@@ -0,0 +1,75 @@
|
|
1
|
+
#include <xmlsec_ext.h>
|
2
|
+
|
3
|
+
VALUE mXmlSec, cXmlSecError;
|
4
|
+
|
5
|
+
/* Ruby Extension initializer */
|
6
|
+
void Init_xmlsec_ext() {
|
7
|
+
#ifndef XMLSEC_NO_XSLT
|
8
|
+
xsltSecurityPrefsPtr xsltSecPrefs = NULL;
|
9
|
+
#endif /* XMLSEC_NO_XSLT */
|
10
|
+
|
11
|
+
mXmlSec = rb_define_module("XmlSec");
|
12
|
+
cXmlSecError = rb_const_get(mXmlSec, rb_intern("Error"));
|
13
|
+
|
14
|
+
/* Init libxml and libxslt libraries */
|
15
|
+
xmlInitParser();
|
16
|
+
LIBXML_TEST_VERSION
|
17
|
+
xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
18
|
+
xmlSubstituteEntitiesDefault(1);
|
19
|
+
#ifndef XMLSEC_NO_XSLT
|
20
|
+
xmlIndentTreeOutput = 1;
|
21
|
+
#endif /* XMLSEC_NO_XSLT */
|
22
|
+
|
23
|
+
/* Init libxslt */
|
24
|
+
#ifndef XMLSEC_NO_XSLT
|
25
|
+
/* disable everything */
|
26
|
+
xsltSecPrefs = xsltNewSecurityPrefs();
|
27
|
+
xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_READ_FILE, xsltSecurityForbid);
|
28
|
+
xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_WRITE_FILE, xsltSecurityForbid);
|
29
|
+
xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_CREATE_DIRECTORY, xsltSecurityForbid);
|
30
|
+
xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_READ_NETWORK, xsltSecurityForbid);
|
31
|
+
xsltSetSecurityPrefs(xsltSecPrefs, XSLT_SECPREF_WRITE_NETWORK, xsltSecurityForbid);
|
32
|
+
xsltSetDefaultSecurityPrefs(xsltSecPrefs);
|
33
|
+
#endif /* XMLSEC_NO_XSLT */
|
34
|
+
|
35
|
+
/* Init xmlsec library */
|
36
|
+
if(xmlSecInit() < 0) {
|
37
|
+
rb_raise(rb_eRuntimeError, "Error: xmlsec initialization failed.");
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
/* Check loaded library version */
|
42
|
+
if(xmlSecCheckVersion() != 1) {
|
43
|
+
rb_raise(rb_eRuntimeError, "Error: loaded xmlsec library version is not compatible.");
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
|
47
|
+
/* Load default crypto engine if we are supporting dynamic
|
48
|
+
* loading for xmlsec-crypto libraries. Use the crypto library
|
49
|
+
* name ("openssl", "nss", etc.) to load corresponding
|
50
|
+
* xmlsec-crypto library.
|
51
|
+
*/
|
52
|
+
#ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING
|
53
|
+
if(xmlSecCryptoDLLoadLibrary(BAD_CAST XMLSEC_CRYPTO) < 0) {
|
54
|
+
rb_raise(rb_eRuntimeError, "Error: unable to load default xmlsec-crypto library. Make sure\n"
|
55
|
+
"that you have it installed and check shared libraries path\n"
|
56
|
+
"(LD_LIBRARY_PATH) envornment variable.\n");
|
57
|
+
return;
|
58
|
+
}
|
59
|
+
#endif /* XMLSEC_CRYPTO_DYNAMIC_LOADING */
|
60
|
+
|
61
|
+
/* Init crypto library */
|
62
|
+
if(xmlSecCryptoAppInit(NULL) < 0) {
|
63
|
+
rb_raise(rb_eRuntimeError, "Error: crypto initialization failed.");
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
|
67
|
+
/* Init xmlsec-crypto library */
|
68
|
+
if(xmlSecCryptoInit() < 0) {
|
69
|
+
rb_raise(rb_eRuntimeError, "Error: xmlsec-crypto initialization failed.");
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
|
73
|
+
init_xmlsec_sign();
|
74
|
+
init_xmlsec_verify();
|
75
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#ifndef XMLSEC_EXT_H
|
2
|
+
#define XMLSEC_EXT_H
|
3
|
+
|
4
|
+
#include <ruby.h>
|
5
|
+
|
6
|
+
// libxml
|
7
|
+
#include <libxml/tree.h>
|
8
|
+
#include <libxml/xmlmemory.h>
|
9
|
+
#include <libxml/parser.h>
|
10
|
+
#include <libxml/xpath.h>
|
11
|
+
#include <libxml/xpathInternals.h>
|
12
|
+
|
13
|
+
// libxslt
|
14
|
+
#include <libxslt/xslt.h>
|
15
|
+
#include <libxslt/security.h>
|
16
|
+
|
17
|
+
// xmlsec
|
18
|
+
#include <xmlsec/xmlsec.h>
|
19
|
+
#include <xmlsec/xmltree.h>
|
20
|
+
#include <xmlsec/xmldsig.h>
|
21
|
+
#include <xmlsec/xmlenc.h>
|
22
|
+
#include <xmlsec/templates.h>
|
23
|
+
#include <xmlsec/crypto.h>
|
24
|
+
#include <xmlsec/bn.h>
|
25
|
+
|
26
|
+
#include <sign.h>
|
27
|
+
#include <verify.h>
|
28
|
+
|
29
|
+
#endif /* ifndef XMLSEC_EXT_H */
|
Binary file
|
Binary file
|
data/lib/xmlsec.rb
ADDED
data/lib/xmlsec/error.rb
ADDED
data/spec/assets/csr.pem
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
-----BEGIN CERTIFICATE REQUEST-----
|
2
|
+
MIIBgTCB6wIBADBCMQswCQYDVQQGEwJYWDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5
|
3
|
+
MRwwGgYDVQQKDBNEZWZhdWx0IENvbXBhbnkgTHRkMIGfMA0GCSqGSIb3DQEBAQUA
|
4
|
+
A4GNADCBiQKBgQDMCRfYnC/IfqFS1e32DscDP8ZA97+d7FmMbBU59m1wtVHbjDNK
|
5
|
+
owpSb636GwOueBmivuZhuTOsXBYlkq4zNN04EUx0kAFdDbqKThfkbehC8sK+9/Go
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
+
oSFJwCaVhg3t/vR/CJyc7ijBlI6isITyvsiod4Yk0JkEsHwg2TOJeosC+GFERJNy
|
15
|
+
NEbzBQcEmezIPVqJiKftBTwKl6A0nliRZwL8/9wmvhCwWxwHejItuQVb1M2P8ASb
|
16
|
+
GUpuvnynTzHw62nuP9IRteCjJu5hYzKlTs07BsNaXXScS3npsC/6tqZskaylywjY
|
17
|
+
QbSlsyDjbIgI2+ZwuBoVMHdMtYoI6ohvncZYZwAgAOMVh2YCQ34MvQ==
|
18
|
+
-----END RSA PRIVATE KEY-----
|
@@ -0,0 +1,6 @@
|
|
1
|
+
-----BEGIN PUBLIC KEY-----
|
2
|
+
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMCRfYnC/IfqFS1e32DscDP8ZA
|
3
|
+
97+d7FmMbBU59m1wtVHbjDNKowpSb636GwOueBmivuZhuTOsXBYlkq4zNN04EUx0
|
4
|
+
kAFdDbqKThfkbehC8sK+9/GoahyLgGc5rZOfG+lHDuDWN6SMbGff3dsWA5ckiLSC
|
5
|
+
yPH6FyvbSot1oScnJwIDAQAB
|
6
|
+
-----END PUBLIC KEY-----
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!--
|
3
|
+
XML Security Library test file
|
4
|
+
-->
|
5
|
+
<Service version="2.0">
|
6
|
+
<Data>
|
7
|
+
<str> Hello, World! The euro sign (ą) </str>
|
8
|
+
<smfing>
|
9
|
+
<!-- XML Security Library test file -->
|
10
|
+
<test1 somettr="VALUE"/>
|
11
|
+
<TEST2 SOMETTR="VALUE"/>
|
12
|
+
</smfing>
|
13
|
+
</Data>
|
14
|
+
<Security><Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
15
|
+
<SignedInfo>
|
16
|
+
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
|
17
|
+
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
|
18
|
+
<Reference>
|
19
|
+
<Transforms>
|
20
|
+
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
21
|
+
</Transforms>
|
22
|
+
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
|
23
|
+
<DigestValue>cWRQ7e5Hp3G/m+AsreGhIefcB0A=</DigestValue>
|
24
|
+
</Reference>
|
25
|
+
</SignedInfo>
|
26
|
+
<SignatureValue>lxGeNKU+RS7T8DsAT+ZlPxO/e0OLiq1tIUiZ1LWYLB3RxACvnre15pNniRCjXRrZ
|
27
|
+
He6Kr+0xrqhfQLVPqHi0Gj7z8Ac0sTdICCCxJTzq1YQ2PhSRgXT8TGeXzVI4VIMp
|
28
|
+
D0ypoBWhtOLvwaCpiX4mHZ3NjpqbrdNcxVGnoGh5Dm0=</SignatureValue>
|
29
|
+
<KeyInfo>
|
30
|
+
<X509Data>
|
31
|
+
<X509Certificate>MIIB+zCCAWQCCQCNDSfdaw1XODANBgkqhkiG9w0BAQUFADBCMQswCQYDVQQGEwJY
|
32
|
+
WDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZhdWx0IENvbXBh
|
33
|
+
bnkgTHRkMB4XDTEyMDMxMjE0MjExNVoXDTEzMDMxMjE0MjExNVowQjELMAkGA1UE
|
34
|
+
BhMCWFgxFTATBgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBD
|
35
|
+
b21wYW55IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzAkX2JwvyH6h
|
36
|
+
UtXt9g7HAz/GQPe/nexZjGwVOfZtcLVR24wzSqMKUm+t+hsDrngZor7mYbkzrFwW
|
37
|
+
JZKuMzTdOBFMdJABXQ26ik4X5G3oQvLCvvfxqGoci4BnOa2TnxvpRw7g1jekjGxn
|
38
|
+
393bFgOXJIi0gsjx+hcr20qLdaEnJycCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBA
|
39
|
+
8qZt/THE1SmLZ/55yTh3rxgcfdlJzk+iE9VYd9aseGHSbZmOEDjmtF6hNJBYw/BI
|
40
|
+
oxAOVnMI6cuAbNe5ydub5YeelyJGrlPEcIs+lm2GkUCRFZd4krVO4r2wptD0KP8a
|
41
|
+
5iD8CBI9Bl39pXP7k6pEM1UVPUfxyT/h7I2dpqxp+Q==</X509Certificate>
|
42
|
+
</X509Data>
|
43
|
+
</KeyInfo>
|
44
|
+
</Signature></Security></Service>
|