moxml 0.1.24 → 0.1.26
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.
- checksums.yaml +4 -4
- data/.github/workflows/docs.yml +1 -1
- data/.github/workflows/opal.yml +18 -1
- data/.github/workflows/rake.yml +32 -3
- data/.github/workflows/release.yml +9 -0
- data/.github/workflows/round-trip.yml +72 -9
- data/.gitmodules +6 -0
- data/.rubocop_todo.yml +2 -0
- data/Gemfile +9 -1
- data/README.adoc +188 -0
- data/Rakefile +116 -4
- data/docs/signature/algorithms.md +108 -0
- data/docs/signature/architecture.md +148 -0
- data/docs/signature/c14n.md +110 -0
- data/docs/signature/examples.md +109 -0
- data/docs/signature/flows.md +132 -0
- data/docs/signature/quick-reference.md +115 -0
- data/docs/signature/security.md +143 -0
- data/examples/signature/auto_key_extraction.rb +24 -0
- data/examples/signature/enveloped_rsa.rb +45 -0
- data/examples/signature/hmac.rb +33 -0
- data/lib/compat/opal/moxml_boot.rb +4 -0
- data/lib/moxml/adapter.rb +5 -3
- data/lib/moxml/c14n/attribute_handler.rb +71 -0
- data/lib/moxml/c14n/character_encoder.rb +29 -0
- data/lib/moxml/c14n/data_model.rb +145 -0
- data/lib/moxml/c14n/exclusive.rb +188 -0
- data/lib/moxml/c14n/inclusive_10.rb +42 -0
- data/lib/moxml/c14n/inclusive_11.rb +21 -0
- data/lib/moxml/c14n/namespace_context.rb +68 -0
- data/lib/moxml/c14n/namespace_handler.rb +71 -0
- data/lib/moxml/c14n/node.rb +42 -0
- data/lib/moxml/c14n/nodes/attribute_node.rb +50 -0
- data/lib/moxml/c14n/nodes/comment_node.rb +29 -0
- data/lib/moxml/c14n/nodes/element_node.rb +62 -0
- data/lib/moxml/c14n/nodes/namespace_node.rb +41 -0
- data/lib/moxml/c14n/nodes/processing_instruction_node.rb +30 -0
- data/lib/moxml/c14n/nodes/root_node.rb +22 -0
- data/lib/moxml/c14n/nodes/text_node.rb +29 -0
- data/lib/moxml/c14n/nodes.rb +17 -0
- data/lib/moxml/c14n/processor.rb +118 -0
- data/lib/moxml/c14n/writer.rb +121 -0
- data/lib/moxml/c14n/xml_base_handler.rb +140 -0
- data/lib/moxml/c14n.rb +96 -0
- data/lib/moxml/config.rb +1 -1
- data/lib/moxml/signature/algorithms/base64_transform.rb +40 -0
- data/lib/moxml/signature/algorithms/canonicalization_base.rb +87 -0
- data/lib/moxml/signature/algorithms/digest_base.rb +51 -0
- data/lib/moxml/signature/algorithms/dsa_sha.rb +107 -0
- data/lib/moxml/signature/algorithms/ecdsa_sha.rb +125 -0
- data/lib/moxml/signature/algorithms/enveloped_signature_transform.rb +79 -0
- data/lib/moxml/signature/algorithms/exc_c14n_10.rb +23 -0
- data/lib/moxml/signature/algorithms/hmac_sha.rb +117 -0
- data/lib/moxml/signature/algorithms/inclusive_c14n_10.rb +21 -0
- data/lib/moxml/signature/algorithms/inclusive_c14n_11.rb +23 -0
- data/lib/moxml/signature/algorithms/rsa_pkcs1_sha.rb +56 -0
- data/lib/moxml/signature/algorithms/sha1.rb +13 -0
- data/lib/moxml/signature/algorithms/sha224.rb +13 -0
- data/lib/moxml/signature/algorithms/sha256.rb +13 -0
- data/lib/moxml/signature/algorithms/sha384.rb +13 -0
- data/lib/moxml/signature/algorithms/sha512.rb +13 -0
- data/lib/moxml/signature/algorithms/signature_method_base.rb +58 -0
- data/lib/moxml/signature/algorithms/transform_base.rb +40 -0
- data/lib/moxml/signature/algorithms.rb +113 -0
- data/lib/moxml/signature/errors.rb +99 -0
- data/lib/moxml/signature/key_extractor.rb +172 -0
- data/lib/moxml/signature/model/algorithm_method.rb +18 -0
- data/lib/moxml/signature/model/digest_method.rb +15 -0
- data/lib/moxml/signature/model/key/dsa_key_value.rb +29 -0
- data/lib/moxml/signature/model/key/ec_key_value.rb +22 -0
- data/lib/moxml/signature/model/key/rsa_key_value.rb +19 -0
- data/lib/moxml/signature/model/key/x509_data.rb +32 -0
- data/lib/moxml/signature/model/key/x509_digest.rb +19 -0
- data/lib/moxml/signature/model/key/x509_issuer_serial.rb +19 -0
- data/lib/moxml/signature/model/key_info.rb +21 -0
- data/lib/moxml/signature/model/key_value.rb +20 -0
- data/lib/moxml/signature/model/object_element.rb +18 -0
- data/lib/moxml/signature/model/reference.rb +22 -0
- data/lib/moxml/signature/model/signature.rb +21 -0
- data/lib/moxml/signature/model/signature_value.rb +16 -0
- data/lib/moxml/signature/model/signed_info.rb +20 -0
- data/lib/moxml/signature/model/transform.rb +16 -0
- data/lib/moxml/signature/model/transforms.rb +36 -0
- data/lib/moxml/signature/model.rb +35 -0
- data/lib/moxml/signature/parser.rb +270 -0
- data/lib/moxml/signature/reference_resolver.rb +79 -0
- data/lib/moxml/signature/reference_result.rb +22 -0
- data/lib/moxml/signature/serializer.rb +163 -0
- data/lib/moxml/signature/signer.rb +73 -0
- data/lib/moxml/signature/single_verification_result.rb +31 -0
- data/lib/moxml/signature/transform_pipeline.rb +106 -0
- data/lib/moxml/signature/verification_result.rb +27 -0
- data/lib/moxml/signature/verifier.rb +129 -0
- data/lib/moxml/signature.rb +94 -0
- data/lib/moxml/version.rb +1 -1
- data/lib/moxml.rb +2 -0
- data/moxml.gemspec +1 -1
- data/reference-docs/w3c-xmldsig-bestpractices.md +216 -0
- data/reference-docs/w3c-xmldsig-core.md +400 -0
- data/spec/fixtures/xmldsig/keys/rsa_private.pem +28 -0
- data/spec/fixtures/xmldsig/keys/rsa_public.pem +9 -0
- data/spec/fixtures/xmldsig/keys/rsa_ref.pem +15 -0
- data/spec/fixtures/xmldsig/keys/rsa_ref.pub +6 -0
- data/spec/fixtures/xmldsig/sign2-doc.xml +6 -0
- data/spec/fixtures/xmldsig/sign2-result.xml +25 -0
- data/spec/fixtures/xmldsig/sign3-result.xml +39 -0
- data/spec/moxml/adapter/platform_spec.rb +64 -46
- data/spec/moxml/c14n/api_spec.rb +117 -0
- data/spec/moxml/c14n/c14n_spec.rb +88 -0
- data/spec/moxml/c14n/comments_pis_spec.rb +65 -0
- data/spec/moxml/c14n/inclusive10_spec.rb +60 -0
- data/spec/moxml/c14n/namespace_edge_cases_spec.rb +88 -0
- data/spec/moxml/c14n/xml_attributes_spec.rb +54 -0
- data/spec/moxml/opal_oga_adapter_spec.rb +14 -0
- data/spec/moxml/opal_oga_features_spec.rb +212 -0
- data/spec/moxml/opal_oga_smoke_spec.rb +35 -0
- data/spec/moxml/signature/algorithms/base64_transform_spec.rb +26 -0
- data/spec/moxml/signature/algorithms/digest_base_spec.rb +72 -0
- data/spec/moxml/signature/algorithms/dsa_sha_spec.rb +46 -0
- data/spec/moxml/signature/algorithms/ecdsa_sha_spec.rb +72 -0
- data/spec/moxml/signature/algorithms/enveloped_signature_transform_spec.rb +40 -0
- data/spec/moxml/signature/algorithms/hmac_sha_spec.rb +71 -0
- data/spec/moxml/signature/algorithms/rsa_pkcs1_sha_spec.rb +55 -0
- data/spec/moxml/signature/algorithms_spec.rb +76 -0
- data/spec/moxml/signature/cross_verify_spec.rb +64 -0
- data/spec/moxml/signature/edge_cases_spec.rb +284 -0
- data/spec/moxml/signature/fixtures_spec.rb +80 -0
- data/spec/moxml/signature/key_extractor_spec.rb +96 -0
- data/spec/moxml/signature/model_spec.rb +54 -0
- data/spec/moxml/signature/round_trip_spec.rb +113 -0
- data/spec/moxml/xpath/functions/node_functions_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +115 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "spec_helper"
|
|
4
|
+
require "moxml/signature"
|
|
5
|
+
|
|
6
|
+
RSpec.describe Moxml::Signature::Model do
|
|
7
|
+
describe Moxml::Signature::Model::Signature do
|
|
8
|
+
it "stores its components" do
|
|
9
|
+
si = Moxml::Signature::Model::SignedInfo.new
|
|
10
|
+
sv = Moxml::Signature::Model::SignatureValue.new(value: "abc")
|
|
11
|
+
sig = described_class.new(id: "S1", signed_info: si, signature_value: sv)
|
|
12
|
+
expect(sig.id).to eq("S1")
|
|
13
|
+
expect(sig.signed_info).to equal(si)
|
|
14
|
+
expect(sig.signature_value).to equal(sv)
|
|
15
|
+
expect(sig.objects).to eq([])
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
describe Moxml::Signature::Model::Reference do
|
|
20
|
+
it "accepts uri, transforms, and digest method" do
|
|
21
|
+
t = Moxml::Signature::Model::Transforms.new(
|
|
22
|
+
transforms: [Moxml::Signature::Model::Transform.new(
|
|
23
|
+
algorithm: "http://www.w3.org/2000/09/xmldsig#enveloped-signature",
|
|
24
|
+
)],
|
|
25
|
+
)
|
|
26
|
+
dm = Moxml::Signature::Model::DigestMethod.new(
|
|
27
|
+
algorithm: "http://www.w3.org/2001/04/xmlenc#sha256",
|
|
28
|
+
)
|
|
29
|
+
ref = described_class.new(uri: "", transforms: t, digest_method: dm,
|
|
30
|
+
digest_value: "abc=")
|
|
31
|
+
expect(ref.uri).to eq("")
|
|
32
|
+
expect(ref.transforms.transforms.size).to eq(1)
|
|
33
|
+
expect(ref.digest_method.algorithm).to eq(
|
|
34
|
+
"http://www.w3.org/2001/04/xmlenc#sha256",
|
|
35
|
+
)
|
|
36
|
+
expect(ref.digest_value).to eq("abc=")
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe Moxml::Signature::Model::Transforms do
|
|
41
|
+
it "is empty by default" do
|
|
42
|
+
expect(described_class.new).to be_empty
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "appends transforms with <<" do
|
|
46
|
+
transforms = described_class.new
|
|
47
|
+
t = Moxml::Signature::Model::Transform.new(
|
|
48
|
+
algorithm: "http://www.w3.org/2000/09/xmldsig#base64",
|
|
49
|
+
)
|
|
50
|
+
transforms << t
|
|
51
|
+
expect(transforms.size).to eq(1)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "spec_helper"
|
|
4
|
+
require "moxml/signature"
|
|
5
|
+
require "openssl"
|
|
6
|
+
|
|
7
|
+
# End-to-end signing + verification, including tamper detection and
|
|
8
|
+
# wrong-key rejection. Uses real model instances and real OpenSSL keys
|
|
9
|
+
# per the project's "no doubles" rule.
|
|
10
|
+
RSpec.describe "Moxml XML Signature end-to-end round trip" do
|
|
11
|
+
let(:ctx) { Moxml.new(:nokogiri) }
|
|
12
|
+
let(:private_key) { OpenSSL::PKey::RSA.generate(2048) }
|
|
13
|
+
let(:document_xml) { "<doc><greeting>Hello, World!</greeting></doc>" }
|
|
14
|
+
|
|
15
|
+
let(:common_options) do
|
|
16
|
+
{
|
|
17
|
+
context: ctx,
|
|
18
|
+
signature_method: "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
|
|
19
|
+
canonicalization_method: "http://www.w3.org/2001/10/xml-exc-c14n#",
|
|
20
|
+
digest_method: "http://www.w3.org/2001/04/xmlenc#sha256",
|
|
21
|
+
reference_uri: "",
|
|
22
|
+
transforms: ["http://www.w3.org/2000/09/xmldsig#enveloped-signature"],
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def sign_and_attach(xml, key, **opts)
|
|
27
|
+
doc = ctx.parse(xml)
|
|
28
|
+
signature = Moxml::Signature.sign(document: doc, key: key, **common_options.merge(opts))
|
|
29
|
+
serialized = Moxml::Signature::Serializer.new(context: ctx).serialize(signature)
|
|
30
|
+
doc.root.add_child(serialized.root)
|
|
31
|
+
doc
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe "RSA-SHA256 round trip" do
|
|
35
|
+
it "verifies a freshly-signed document" do
|
|
36
|
+
doc = sign_and_attach(document_xml, private_key)
|
|
37
|
+
result = Moxml::Signature.verify(context: ctx, document: doc, key: private_key)
|
|
38
|
+
expect(result.valid?).to be true
|
|
39
|
+
expect(result.signature_count).to eq(1)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
it "verifies with the public key alone" do
|
|
43
|
+
doc = sign_and_attach(document_xml, private_key)
|
|
44
|
+
pub = OpenSSL::PKey::RSA.new(private_key.public_to_pem)
|
|
45
|
+
result = Moxml::Signature.verify(context: ctx, document: doc, key: pub)
|
|
46
|
+
expect(result.valid?).to be true
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it "detects payload tampering" do
|
|
50
|
+
doc = sign_and_attach(document_xml, private_key)
|
|
51
|
+
greeting = doc.at_xpath("//greeting")
|
|
52
|
+
greeting.text = "Goodbye, World!"
|
|
53
|
+
result = Moxml::Signature.verify(context: ctx, document: doc, key: private_key)
|
|
54
|
+
expect(result.valid?).to be false
|
|
55
|
+
# SignatureValue still matches (SignedInfo unchanged) but reference
|
|
56
|
+
# digest mismatches.
|
|
57
|
+
expect(result.results.first.signature_valid?).to be true
|
|
58
|
+
expect(result.results.first.references.first.valid?).to be false
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "detects SignedInfo tampering" do
|
|
62
|
+
doc = sign_and_attach(document_xml, private_key)
|
|
63
|
+
dv = doc.at_xpath("//ds:DigestValue",
|
|
64
|
+
"ds" => "http://www.w3.org/2000/09/xmldsig#")
|
|
65
|
+
dv.text = Base64.strict_encode64("x" * 32)
|
|
66
|
+
result = Moxml::Signature.verify(context: ctx, document: doc, key: private_key)
|
|
67
|
+
expect(result.valid?).to be false
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it "rejects an unrelated verification key" do
|
|
71
|
+
doc = sign_and_attach(document_xml, private_key)
|
|
72
|
+
other = OpenSSL::PKey::RSA.generate(2048)
|
|
73
|
+
result = Moxml::Signature.verify(context: ctx, document: doc, key: other)
|
|
74
|
+
expect(result.valid?).to be false
|
|
75
|
+
expect(result.results.first.signature_valid?).to be false
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
describe "HMAC-SHA256 round trip" do
|
|
80
|
+
let(:hmac_options) do
|
|
81
|
+
common_options.merge(
|
|
82
|
+
signature_method: "http://www.w3.org/2001/04/xmldsig-more#hmac-sha256",
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
it "verifies with the shared secret" do
|
|
87
|
+
doc = sign_and_attach(document_xml, "shared-secret", **hmac_options)
|
|
88
|
+
result = Moxml::Signature.verify(context: ctx, document: doc, key: "shared-secret")
|
|
89
|
+
expect(result.valid?).to be true
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
it "rejects the wrong secret" do
|
|
93
|
+
doc = sign_and_attach(document_xml, "shared-secret", **hmac_options)
|
|
94
|
+
result = Moxml::Signature.verify(context: ctx, document: doc, key: "wrong-secret")
|
|
95
|
+
expect(result.valid?).to be false
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
describe "fixture key" do
|
|
100
|
+
let(:pem_path) do
|
|
101
|
+
File.expand_path("../../fixtures/xmldsig/keys/rsa_private.pem", __dir__)
|
|
102
|
+
end
|
|
103
|
+
let(:fixture_key) { OpenSSL::PKey::RSA.new(File.read(pem_path)) }
|
|
104
|
+
|
|
105
|
+
it "loads and round-trips" do
|
|
106
|
+
skip "fixture key not present" unless File.exist?(pem_path)
|
|
107
|
+
|
|
108
|
+
doc = sign_and_attach(document_xml, fixture_key)
|
|
109
|
+
result = Moxml::Signature.verify(context: ctx, document: doc, key: fixture_key)
|
|
110
|
+
expect(result.valid?).to be true
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -101,7 +101,7 @@ RSpec.configure do |config|
|
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
Moxml.configure do |config|
|
|
104
|
-
config.adapter = RUBY_ENGINE == "opal" ?
|
|
104
|
+
config.adapter = RUBY_ENGINE == "opal" ? Moxml::Config::OPAL_DEFAULT_ADAPTER : Moxml::Config::DEFAULT_ADAPTER
|
|
105
105
|
config.strict_parsing = true
|
|
106
106
|
config.default_encoding = "UTF-8"
|
|
107
107
|
config.entity_load_mode = :optional if RUBY_ENGINE == "opal"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moxml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.26
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |
|
|
14
14
|
Moxml is a unified XML manipulation library that provides a common API
|
|
@@ -28,6 +28,7 @@ files:
|
|
|
28
28
|
- ".github/workflows/release.yml"
|
|
29
29
|
- ".github/workflows/round-trip.yml"
|
|
30
30
|
- ".gitignore"
|
|
31
|
+
- ".gitmodules"
|
|
31
32
|
- ".rspec"
|
|
32
33
|
- ".rspec-opal"
|
|
33
34
|
- ".rubocop.yml"
|
|
@@ -81,6 +82,13 @@ files:
|
|
|
81
82
|
- docs/_tutorials/namespace-handling.adoc
|
|
82
83
|
- docs/_tutorials/xpath-queries.adoc
|
|
83
84
|
- docs/index.adoc
|
|
85
|
+
- docs/signature/algorithms.md
|
|
86
|
+
- docs/signature/architecture.md
|
|
87
|
+
- docs/signature/c14n.md
|
|
88
|
+
- docs/signature/examples.md
|
|
89
|
+
- docs/signature/flows.md
|
|
90
|
+
- docs/signature/quick-reference.md
|
|
91
|
+
- docs/signature/security.md
|
|
84
92
|
- examples/README.md
|
|
85
93
|
- examples/api_client/README.md
|
|
86
94
|
- examples/api_client/api_client.rb
|
|
@@ -95,6 +103,9 @@ files:
|
|
|
95
103
|
- examples/sax_parsing/example.xml
|
|
96
104
|
- examples/sax_parsing/large_file.rb
|
|
97
105
|
- examples/sax_parsing/simple_parser.rb
|
|
106
|
+
- examples/signature/auto_key_extraction.rb
|
|
107
|
+
- examples/signature/enveloped_rsa.rb
|
|
108
|
+
- examples/signature/hmac.rb
|
|
98
109
|
- examples/web_scraper/README.md
|
|
99
110
|
- examples/web_scraper/example_page.html
|
|
100
111
|
- examples/web_scraper/web_scraper.rb
|
|
@@ -138,6 +149,27 @@ files:
|
|
|
138
149
|
- lib/moxml/adapter/rexml.rb
|
|
139
150
|
- lib/moxml/attribute.rb
|
|
140
151
|
- lib/moxml/builder.rb
|
|
152
|
+
- lib/moxml/c14n.rb
|
|
153
|
+
- lib/moxml/c14n/attribute_handler.rb
|
|
154
|
+
- lib/moxml/c14n/character_encoder.rb
|
|
155
|
+
- lib/moxml/c14n/data_model.rb
|
|
156
|
+
- lib/moxml/c14n/exclusive.rb
|
|
157
|
+
- lib/moxml/c14n/inclusive_10.rb
|
|
158
|
+
- lib/moxml/c14n/inclusive_11.rb
|
|
159
|
+
- lib/moxml/c14n/namespace_context.rb
|
|
160
|
+
- lib/moxml/c14n/namespace_handler.rb
|
|
161
|
+
- lib/moxml/c14n/node.rb
|
|
162
|
+
- lib/moxml/c14n/nodes.rb
|
|
163
|
+
- lib/moxml/c14n/nodes/attribute_node.rb
|
|
164
|
+
- lib/moxml/c14n/nodes/comment_node.rb
|
|
165
|
+
- lib/moxml/c14n/nodes/element_node.rb
|
|
166
|
+
- lib/moxml/c14n/nodes/namespace_node.rb
|
|
167
|
+
- lib/moxml/c14n/nodes/processing_instruction_node.rb
|
|
168
|
+
- lib/moxml/c14n/nodes/root_node.rb
|
|
169
|
+
- lib/moxml/c14n/nodes/text_node.rb
|
|
170
|
+
- lib/moxml/c14n/processor.rb
|
|
171
|
+
- lib/moxml/c14n/writer.rb
|
|
172
|
+
- lib/moxml/c14n/xml_base_handler.rb
|
|
141
173
|
- lib/moxml/cdata.rb
|
|
142
174
|
- lib/moxml/comment.rb
|
|
143
175
|
- lib/moxml/config.rb
|
|
@@ -163,6 +195,55 @@ files:
|
|
|
163
195
|
- lib/moxml/sax/element_handler.rb
|
|
164
196
|
- lib/moxml/sax/handler.rb
|
|
165
197
|
- lib/moxml/sax/namespace_splitter.rb
|
|
198
|
+
- lib/moxml/signature.rb
|
|
199
|
+
- lib/moxml/signature/algorithms.rb
|
|
200
|
+
- lib/moxml/signature/algorithms/base64_transform.rb
|
|
201
|
+
- lib/moxml/signature/algorithms/canonicalization_base.rb
|
|
202
|
+
- lib/moxml/signature/algorithms/digest_base.rb
|
|
203
|
+
- lib/moxml/signature/algorithms/dsa_sha.rb
|
|
204
|
+
- lib/moxml/signature/algorithms/ecdsa_sha.rb
|
|
205
|
+
- lib/moxml/signature/algorithms/enveloped_signature_transform.rb
|
|
206
|
+
- lib/moxml/signature/algorithms/exc_c14n_10.rb
|
|
207
|
+
- lib/moxml/signature/algorithms/hmac_sha.rb
|
|
208
|
+
- lib/moxml/signature/algorithms/inclusive_c14n_10.rb
|
|
209
|
+
- lib/moxml/signature/algorithms/inclusive_c14n_11.rb
|
|
210
|
+
- lib/moxml/signature/algorithms/rsa_pkcs1_sha.rb
|
|
211
|
+
- lib/moxml/signature/algorithms/sha1.rb
|
|
212
|
+
- lib/moxml/signature/algorithms/sha224.rb
|
|
213
|
+
- lib/moxml/signature/algorithms/sha256.rb
|
|
214
|
+
- lib/moxml/signature/algorithms/sha384.rb
|
|
215
|
+
- lib/moxml/signature/algorithms/sha512.rb
|
|
216
|
+
- lib/moxml/signature/algorithms/signature_method_base.rb
|
|
217
|
+
- lib/moxml/signature/algorithms/transform_base.rb
|
|
218
|
+
- lib/moxml/signature/errors.rb
|
|
219
|
+
- lib/moxml/signature/key_extractor.rb
|
|
220
|
+
- lib/moxml/signature/model.rb
|
|
221
|
+
- lib/moxml/signature/model/algorithm_method.rb
|
|
222
|
+
- lib/moxml/signature/model/digest_method.rb
|
|
223
|
+
- lib/moxml/signature/model/key/dsa_key_value.rb
|
|
224
|
+
- lib/moxml/signature/model/key/ec_key_value.rb
|
|
225
|
+
- lib/moxml/signature/model/key/rsa_key_value.rb
|
|
226
|
+
- lib/moxml/signature/model/key/x509_data.rb
|
|
227
|
+
- lib/moxml/signature/model/key/x509_digest.rb
|
|
228
|
+
- lib/moxml/signature/model/key/x509_issuer_serial.rb
|
|
229
|
+
- lib/moxml/signature/model/key_info.rb
|
|
230
|
+
- lib/moxml/signature/model/key_value.rb
|
|
231
|
+
- lib/moxml/signature/model/object_element.rb
|
|
232
|
+
- lib/moxml/signature/model/reference.rb
|
|
233
|
+
- lib/moxml/signature/model/signature.rb
|
|
234
|
+
- lib/moxml/signature/model/signature_value.rb
|
|
235
|
+
- lib/moxml/signature/model/signed_info.rb
|
|
236
|
+
- lib/moxml/signature/model/transform.rb
|
|
237
|
+
- lib/moxml/signature/model/transforms.rb
|
|
238
|
+
- lib/moxml/signature/parser.rb
|
|
239
|
+
- lib/moxml/signature/reference_resolver.rb
|
|
240
|
+
- lib/moxml/signature/reference_result.rb
|
|
241
|
+
- lib/moxml/signature/serializer.rb
|
|
242
|
+
- lib/moxml/signature/signer.rb
|
|
243
|
+
- lib/moxml/signature/single_verification_result.rb
|
|
244
|
+
- lib/moxml/signature/transform_pipeline.rb
|
|
245
|
+
- lib/moxml/signature/verification_result.rb
|
|
246
|
+
- lib/moxml/signature/verifier.rb
|
|
166
247
|
- lib/moxml/text.rb
|
|
167
248
|
- lib/moxml/version.rb
|
|
168
249
|
- lib/moxml/xml_utils.rb
|
|
@@ -181,6 +262,8 @@ files:
|
|
|
181
262
|
- lib/moxml/xpath/ruby/node.rb
|
|
182
263
|
- moxml.gemspec
|
|
183
264
|
- old-specs/moxml/adapter/customized_libxml/.gitkeep
|
|
265
|
+
- reference-docs/w3c-xmldsig-bestpractices.md
|
|
266
|
+
- reference-docs/w3c-xmldsig-core.md
|
|
184
267
|
- scripts/format_xml.rb
|
|
185
268
|
- scripts/pretty_format_xml.rb
|
|
186
269
|
- sig/moxml.rbs
|
|
@@ -278,6 +361,13 @@ files:
|
|
|
278
361
|
- spec/fixtures/w3c/namespaces/1.0/LICENSE.md
|
|
279
362
|
- spec/fixtures/w3c/namespaces/1.0/README.adoc
|
|
280
363
|
- spec/fixtures/w3c/namespaces/1.0/rmt-ns10.xml
|
|
364
|
+
- spec/fixtures/xmldsig/keys/rsa_private.pem
|
|
365
|
+
- spec/fixtures/xmldsig/keys/rsa_public.pem
|
|
366
|
+
- spec/fixtures/xmldsig/keys/rsa_ref.pem
|
|
367
|
+
- spec/fixtures/xmldsig/keys/rsa_ref.pub
|
|
368
|
+
- spec/fixtures/xmldsig/sign2-doc.xml
|
|
369
|
+
- spec/fixtures/xmldsig/sign2-result.xml
|
|
370
|
+
- spec/fixtures/xmldsig/sign3-result.xml
|
|
281
371
|
- spec/integration/README.md
|
|
282
372
|
- spec/integration/all_adapters_spec.rb
|
|
283
373
|
- spec/integration/headed_ox_integration_spec.rb
|
|
@@ -325,6 +415,12 @@ files:
|
|
|
325
415
|
- spec/moxml/allocation_guard_spec.rb
|
|
326
416
|
- spec/moxml/attribute_spec.rb
|
|
327
417
|
- spec/moxml/builder_spec.rb
|
|
418
|
+
- spec/moxml/c14n/api_spec.rb
|
|
419
|
+
- spec/moxml/c14n/c14n_spec.rb
|
|
420
|
+
- spec/moxml/c14n/comments_pis_spec.rb
|
|
421
|
+
- spec/moxml/c14n/inclusive10_spec.rb
|
|
422
|
+
- spec/moxml/c14n/namespace_edge_cases_spec.rb
|
|
423
|
+
- spec/moxml/c14n/xml_attributes_spec.rb
|
|
328
424
|
- spec/moxml/cdata_spec.rb
|
|
329
425
|
- spec/moxml/comment_spec.rb
|
|
330
426
|
- spec/moxml/config_spec.rb
|
|
@@ -352,11 +448,28 @@ files:
|
|
|
352
448
|
- spec/moxml/node_set_spec.rb
|
|
353
449
|
- spec/moxml/node_spec.rb
|
|
354
450
|
- spec/moxml/node_type_map_spec.rb
|
|
451
|
+
- spec/moxml/opal_oga_adapter_spec.rb
|
|
452
|
+
- spec/moxml/opal_oga_features_spec.rb
|
|
453
|
+
- spec/moxml/opal_oga_smoke_spec.rb
|
|
355
454
|
- spec/moxml/opal_rexml_adapter_spec.rb
|
|
356
455
|
- spec/moxml/opal_smoke_spec.rb
|
|
357
456
|
- spec/moxml/processing_instruction_spec.rb
|
|
358
457
|
- spec/moxml/sax/namespace_splitter_spec.rb
|
|
359
458
|
- spec/moxml/sax_spec.rb
|
|
459
|
+
- spec/moxml/signature/algorithms/base64_transform_spec.rb
|
|
460
|
+
- spec/moxml/signature/algorithms/digest_base_spec.rb
|
|
461
|
+
- spec/moxml/signature/algorithms/dsa_sha_spec.rb
|
|
462
|
+
- spec/moxml/signature/algorithms/ecdsa_sha_spec.rb
|
|
463
|
+
- spec/moxml/signature/algorithms/enveloped_signature_transform_spec.rb
|
|
464
|
+
- spec/moxml/signature/algorithms/hmac_sha_spec.rb
|
|
465
|
+
- spec/moxml/signature/algorithms/rsa_pkcs1_sha_spec.rb
|
|
466
|
+
- spec/moxml/signature/algorithms_spec.rb
|
|
467
|
+
- spec/moxml/signature/cross_verify_spec.rb
|
|
468
|
+
- spec/moxml/signature/edge_cases_spec.rb
|
|
469
|
+
- spec/moxml/signature/fixtures_spec.rb
|
|
470
|
+
- spec/moxml/signature/key_extractor_spec.rb
|
|
471
|
+
- spec/moxml/signature/model_spec.rb
|
|
472
|
+
- spec/moxml/signature/round_trip_spec.rb
|
|
360
473
|
- spec/moxml/text_spec.rb
|
|
361
474
|
- spec/moxml/version_spec.rb
|
|
362
475
|
- spec/moxml/xml_utils/.gitkeep
|