pki_express 1.3.1 → 1.3.2

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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +2 -2
  3. data/.github/workflows/test.yml +21 -21
  4. data/.gitignore +27 -27
  5. data/CHANGELOG.md +19 -16
  6. data/Gemfile +8 -7
  7. data/README.md +24 -24
  8. data/Rakefile +6 -6
  9. data/lib/pki_express/auth_complete_result.rb +21 -21
  10. data/lib/pki_express/auth_start_result.rb +76 -76
  11. data/lib/pki_express/authentication.rb +284 -284
  12. data/lib/pki_express/base_signer.rb +54 -54
  13. data/lib/pki_express/cades_signature.rb +89 -89
  14. data/lib/pki_express/cades_signature_starter.rb +242 -242
  15. data/lib/pki_express/check_service_result.rb +15 -15
  16. data/lib/pki_express/command_error.rb +13 -13
  17. data/lib/pki_express/commands.rb +24 -24
  18. data/lib/pki_express/digest_algorithm.rb +118 -118
  19. data/lib/pki_express/digest_algorithm_and_value.rb +30 -30
  20. data/lib/pki_express/discovery_service_result.rb +25 -25
  21. data/lib/pki_express/enum.rb +9 -9
  22. data/lib/pki_express/error_codes.rb +46 -46
  23. data/lib/pki_express/installation_not_found_error.rb +8 -8
  24. data/lib/pki_express/name.rb +47 -47
  25. data/lib/pki_express/oids.rb +30 -30
  26. data/lib/pki_express/pades_certification_level.rb +7 -7
  27. data/lib/pki_express/pades_horizontal_align.rb +9 -9
  28. data/lib/pki_express/pades_measurement_units.rb +8 -8
  29. data/lib/pki_express/pades_page_optimization.rb +50 -50
  30. data/lib/pki_express/pades_page_orientation.rb +9 -9
  31. data/lib/pki_express/pades_paper_size.rb +21 -21
  32. data/lib/pki_express/pades_signature.rb +16 -16
  33. data/lib/pki_express/pades_signature_explorer.rb +30 -30
  34. data/lib/pki_express/pades_signature_starter.rb +251 -251
  35. data/lib/pki_express/pades_signer.rb +274 -274
  36. data/lib/pki_express/pades_signer_info.rb +9 -9
  37. data/lib/pki_express/pades_size.rb +17 -17
  38. data/lib/pki_express/pades_text_horizontal_align.rb +8 -8
  39. data/lib/pki_express/pades_vertical_align.rb +9 -9
  40. data/lib/pki_express/pades_visual_auto_positioning.rb +21 -21
  41. data/lib/pki_express/pades_visual_image.rb +51 -51
  42. data/lib/pki_express/pades_visual_manual_positioning.rb +16 -16
  43. data/lib/pki_express/pades_visual_positioning.rb +27 -27
  44. data/lib/pki_express/pades_visual_rectangle.rb +74 -74
  45. data/lib/pki_express/pades_visual_representation.rb +22 -22
  46. data/lib/pki_express/pades_visual_text.rb +35 -35
  47. data/lib/pki_express/pk_algorithms.rb +157 -157
  48. data/lib/pki_express/pk_certificate.rb +61 -61
  49. data/lib/pki_express/pki_brazil_certificate_fields.rb +57 -57
  50. data/lib/pki_express/pki_brazil_certificate_types.rb +19 -19
  51. data/lib/pki_express/pki_express_config.rb +39 -26
  52. data/lib/pki_express/pki_express_operator.rb +240 -240
  53. data/lib/pki_express/pki_italy_certificate_fields.rb +15 -15
  54. data/lib/pki_express/pki_italy_certificate_types.rb +11 -11
  55. data/lib/pki_express/signature_algorithm_and_value.rb +34 -34
  56. data/lib/pki_express/signature_explorer.rb +74 -74
  57. data/lib/pki_express/signature_finisher.rb +314 -314
  58. data/lib/pki_express/signature_policy_identifier.rb +20 -20
  59. data/lib/pki_express/signature_start_result.rb +12 -12
  60. data/lib/pki_express/signature_starter.rb +116 -116
  61. data/lib/pki_express/signer.rb +151 -151
  62. data/lib/pki_express/standard_signature_policies.rb +58 -58
  63. data/lib/pki_express/timestamp_authority.rb +50 -50
  64. data/lib/pki_express/trust_service_auth_parameters.rb +20 -20
  65. data/lib/pki_express/trust_service_info.rb +37 -37
  66. data/lib/pki_express/trust_service_manager.rb +258 -258
  67. data/lib/pki_express/trust_service_session_result.rb +29 -29
  68. data/lib/pki_express/trust_service_session_types.rb +7 -7
  69. data/lib/pki_express/tsa_authentication_type.rb +14 -14
  70. data/lib/pki_express/validation_error.rb +8 -8
  71. data/lib/pki_express/validation_item.rb +43 -43
  72. data/lib/pki_express/validation_item_types.rb +103 -103
  73. data/lib/pki_express/validation_results.rb +120 -120
  74. data/lib/pki_express/version.rb +3 -3
  75. data/lib/pki_express/version_manager.rb +20 -20
  76. data/lib/pki_express.rb +69 -69
  77. data/pki_express.gemspec +26 -26
  78. data/spec/pki_express/pki_express_config_spec.rb +73 -0
  79. data/spec/pki_express/pki_express_operator_spec.rb +30 -30
  80. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3fe73f3d18d1dc566b80140f294c5028e0e60787dcb5c56e4112af8f0128e5c
4
- data.tar.gz: c5f73243393de32161c70d0ac4933db9b6261cb37e89a2e3e7702c45500240f6
3
+ metadata.gz: 0d86c8e5e27501e0d6b4190e3ef39a4924a15a9c2df9beeca64e6471d126af4a
4
+ data.tar.gz: d456aa97640505edf6e022ce259e106667f955a48e5847645f61051441578bef
5
5
  SHA512:
6
- metadata.gz: 8ceaea14d93ffbda8c76725e7d178e4530a90d928fb2d6ffdbfb5308534f07793ecc0bd40de485d7fd5415a9f3e2812cf2c70c4c4bb277c6831590cb9fd5616d
7
- data.tar.gz: 382bc00219a77605c809fcd3499cca7e1e238faff2896d4ec219533241efc228af99f4697695b309859b519badeff5cdf423751d2ee9b7ce5b473cb949a1c88a
6
+ metadata.gz: 9b9455b5679a94dbae4be8e77c0370b787733e6914fd0fb4ed13395d4c3135ca3bc7673e049f12ce6e3a4310f4066216f0028fe4cd8873711e2f149ed0a3a290
7
+ data.tar.gz: 3645a5bab0674fc5ca7e9e4f43d04358b3ed3fa274dae30e8ecbd3fc94854f071550447d6e6a168fb102784de22101c34128ddf5bb08a6b0fd608141032b5275
data/.gitattributes CHANGED
@@ -1,3 +1,3 @@
1
-
2
- # Enable automatic line ending normalization
1
+
2
+ # Enable automatic line ending normalization
3
3
  * text=auto
@@ -1,22 +1,22 @@
1
- name: Ruby
2
-
3
- on: push
4
-
5
- jobs:
6
- test:
7
- runs-on: ubuntu-latest
8
-
9
- strategy:
10
- matrix:
11
- ruby-version: ['3.1', '2.7']
12
-
13
- steps:
14
- - uses: actions/checkout@v3
15
- - name: Set up Ruby ${{ matrix.ruby-version }}
16
- uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
17
- with:
18
- ruby-version: ${{ matrix.ruby-version }}
19
- - name: Install dependencies
20
- run: bundle install
21
- - name: Run tests
1
+ name: Ruby
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ matrix:
11
+ ruby-version: ['3.1', '2.7']
12
+
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - name: Set up Ruby ${{ matrix.ruby-version }}
16
+ uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
17
+ with:
18
+ ruby-version: ${{ matrix.ruby-version }}
19
+ - name: Install dependencies
20
+ run: bundle install
21
+ - name: Run tests
22
22
  run: bundle exec rake spec
data/.gitignore CHANGED
@@ -1,28 +1,28 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
15
- *.gem
16
- *.rbc
17
- .DS_Store
18
- .bundle
19
- .rvmrc
20
- .ruby-version
21
- .yardoc
22
- .rake_tasks~
23
- Gemfile.lock
24
- coverage/*
25
- doc/*
26
- log/*
27
- pkg/*
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ *.gem
16
+ *.rbc
17
+ .DS_Store
18
+ .bundle
19
+ .rvmrc
20
+ .ruby-version
21
+ .yardoc
22
+ .rake_tasks~
23
+ Gemfile.lock
24
+ coverage/*
25
+ doc/*
26
+ log/*
27
+ pkg/*
28
28
  .idea/*
data/CHANGELOG.md CHANGED
@@ -1,16 +1,19 @@
1
- ## 1.3.1 (2023-03-30)
2
- * Fix pki express operator finalizer
3
- * Improve pathname call with exists
4
-
5
- ## 1.3.0 (2021-08-04)
6
- * Adds culture and time zone attributes to PkiExpressOperator
7
-
8
- ## 1.2.0 (2021-01-25)
9
- * Adds PAdES Explorer
10
-
11
- ## 1.1.0 (2020-09-09)
12
- * Adds PAdES Signer
13
- * Adds support for Trust Services Management
14
-
15
- ## 1.0.0 (2018-04-11)
16
- * First publicly available version
1
+ ## 1.3.2 (2023-03-30)
2
+ * Improve valdiation of PkiExpressConfig's contructor parameters
3
+
4
+ ## 1.3.1 (2023-03-30)
5
+ * Fix pki express operator finalizer
6
+ * Improve pathname call with exists
7
+
8
+ ## 1.3.0 (2021-08-04)
9
+ * Adds culture and time zone attributes to PkiExpressOperator
10
+
11
+ ## 1.2.0 (2021-01-25)
12
+ * Adds PAdES Explorer
13
+
14
+ ## 1.1.0 (2020-09-09)
15
+ * Adds PAdES Signer
16
+ * Adds support for Trust Services Management
17
+
18
+ ## 1.0.0 (2018-04-11)
19
+ * First publicly available version
data/Gemfile CHANGED
@@ -1,8 +1,9 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify the gem's dependencies in pki_express.gemspec
4
- gemspec
5
-
6
- group :development, :test do
7
- gem 'rspec'
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify the gem's dependencies in pki_express.gemspec
4
+ gemspec
5
+
6
+ group :development, :test do
7
+ gem 'rspec', '~> 3.12'
8
+ gem 'faker', '~> 3.1', '>= 3.1.1'
8
9
  end
data/README.md CHANGED
@@ -1,24 +1,24 @@
1
- PKI Express for Ruby
2
- ============================
3
- [![Gem Version](https://badge.fury.io/rb/rest_pki.svg)](https://badge.fury.io/rb/rest_pki)
4
-
5
- This library contains classes that encapsulate the calls to PKI Express.
6
-
7
- The recommended way to install **PKI Expresss lib** is through setting in your Gemfile:
8
-
9
- ````ruby
10
- gem 'pki_express', '~> 1.3.1'
11
- ````
12
-
13
- And with installing via [Bundler](http://bundler.io/) on your project root folder:
14
-
15
- bundle install
16
-
17
- Alternatively, You can install this gem globally by executing the following command:
18
-
19
- gem install pki_express
20
-
21
- Samples
22
- -------
23
- Please visit the [PKI Suite samples repository](https://github.com/LacunaSoftware/PkiSuiteSamples/tree/master/Ruby)
24
- for examples on how to use this library.
1
+ PKI Express for Ruby
2
+ ============================
3
+ [![Gem Version](https://badge.fury.io/rb/pki_express.svg)](https://badge.fury.io/rb/pki_express)
4
+
5
+ This library contains classes that encapsulate the calls to PKI Express.
6
+
7
+ The recommended way to install **PKI Expresss lib** is through setting in your Gemfile:
8
+
9
+ ````ruby
10
+ gem 'pki_express', '~> 1.3.2'
11
+ ````
12
+
13
+ And with installing via [Bundler](http://bundler.io/) on your project root folder:
14
+
15
+ bundle install
16
+
17
+ Alternatively, You can install this gem globally by executing the following command:
18
+
19
+ gem install pki_express
20
+
21
+ Samples
22
+ -------
23
+ Please visit the [PKI Suite samples repository](https://github.com/LacunaSoftware/PkiSuiteSamples/tree/master/Ruby)
24
+ for examples on how to use this library.
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
- require 'rake'
2
- require 'bundler/gem_tasks'
3
- require 'rspec/core/rake_task'
4
-
5
- RSpec::Core::RakeTask.new(:spec) do |t|
6
- t.pattern = Dir.glob('spec/**/*_spec.rb')
1
+ require 'rake'
2
+ require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec) do |t|
6
+ t.pattern = Dir.glob('spec/**/*_spec.rb')
7
7
  end
@@ -1,22 +1,22 @@
1
- module PkiExpress
2
- class AuthCompleteResult
3
-
4
- attr_accessor :certificate, :validation_results
5
-
6
- def initialize(model)
7
- @certificate = nil
8
- @validation_results = nil
9
-
10
- if model
11
- certificate = model.fetch(:certificate)
12
- if certificate
13
- @certificate = PKCertificate.new(certificate)
14
- end
15
- validation_results = model.fetch(:validationResults)
16
- if validation_results
17
- @validation_results = ValidationResults.new(validation_results)
18
- end
19
- end
20
- end
21
- end
1
+ module PkiExpress
2
+ class AuthCompleteResult
3
+
4
+ attr_accessor :certificate, :validation_results
5
+
6
+ def initialize(model)
7
+ @certificate = nil
8
+ @validation_results = nil
9
+
10
+ if model
11
+ certificate = model.fetch(:certificate)
12
+ if certificate
13
+ @certificate = PKCertificate.new(certificate)
14
+ end
15
+ validation_results = model.fetch(:validationResults)
16
+ if validation_results
17
+ @validation_results = ValidationResults.new(validation_results)
18
+ end
19
+ end
20
+ end
21
+ end
22
22
  end
@@ -1,77 +1,77 @@
1
- module PkiExpress
2
- class AuthStartResult
3
- attr_accessor :digest_algorithm_name, :digest_algorithm_oid
4
-
5
- def initialize(model)
6
- @nonce_base64 = nil
7
- @digest_algorithm_name = nil
8
- @digest_algorithm_oid = nil
9
-
10
- if model
11
- @nonce_base64 = model.fetch(:toSignData)
12
- @digest_algorithm_name = model.fetch(:digestAlgorithmName)
13
- @digest_algorithm_oid = model.fetch(:digestAlgorithmOid)
14
- end
15
- end
16
-
17
- # region The "nonce" accessors
18
-
19
- def nonce
20
- _get_nonce
21
- end
22
-
23
- def _get_nonce
24
- unless @nonce_base64
25
- return nil
26
- end
27
-
28
- Base64.decode64(@nonce_base64)
29
- end
30
- private :_get_nonce
31
-
32
- def nonce=(nonce)
33
- _set_nonce(nonce)
34
- end
35
-
36
- def _set_nonce(nonce)
37
- unless nonce
38
- raise 'The provided "nonce" is not valid'
39
- end
40
-
41
- begin
42
- b64 = Base64.encode64(nonce)
43
- rescue Error
44
- raise 'The provided "nonce" is not valid.'
45
- end
46
-
47
- @nonce_base64 = b64
48
- end
49
- private :_set_nonce
50
-
51
- def nonce_base64
52
- _get_nonce_base64
53
- end
54
-
55
- def _get_nonce_base64
56
- @nonce_base64
57
- end
58
- private :_get_nonce_base64
59
-
60
- def nonce_base64=(nonce_base64)
61
- unless nonce_base64
62
- raise 'The provided "nonce_base64" is not valid'
63
- end
64
-
65
- begin
66
- Base64.decode64(nonce_base64)
67
- rescue Error
68
- raise 'The provided "nonce_base64" is not Base64-encoded.'
69
- end
70
-
71
- @nonce_base64 = nonce_base64
72
- end
73
-
74
- #endregion
75
-
76
- end
1
+ module PkiExpress
2
+ class AuthStartResult
3
+ attr_accessor :digest_algorithm_name, :digest_algorithm_oid
4
+
5
+ def initialize(model)
6
+ @nonce_base64 = nil
7
+ @digest_algorithm_name = nil
8
+ @digest_algorithm_oid = nil
9
+
10
+ if model
11
+ @nonce_base64 = model.fetch(:toSignData)
12
+ @digest_algorithm_name = model.fetch(:digestAlgorithmName)
13
+ @digest_algorithm_oid = model.fetch(:digestAlgorithmOid)
14
+ end
15
+ end
16
+
17
+ # region The "nonce" accessors
18
+
19
+ def nonce
20
+ _get_nonce
21
+ end
22
+
23
+ def _get_nonce
24
+ unless @nonce_base64
25
+ return nil
26
+ end
27
+
28
+ Base64.decode64(@nonce_base64)
29
+ end
30
+ private :_get_nonce
31
+
32
+ def nonce=(nonce)
33
+ _set_nonce(nonce)
34
+ end
35
+
36
+ def _set_nonce(nonce)
37
+ unless nonce
38
+ raise 'The provided "nonce" is not valid'
39
+ end
40
+
41
+ begin
42
+ b64 = Base64.encode64(nonce)
43
+ rescue Error
44
+ raise 'The provided "nonce" is not valid.'
45
+ end
46
+
47
+ @nonce_base64 = b64
48
+ end
49
+ private :_set_nonce
50
+
51
+ def nonce_base64
52
+ _get_nonce_base64
53
+ end
54
+
55
+ def _get_nonce_base64
56
+ @nonce_base64
57
+ end
58
+ private :_get_nonce_base64
59
+
60
+ def nonce_base64=(nonce_base64)
61
+ unless nonce_base64
62
+ raise 'The provided "nonce_base64" is not valid'
63
+ end
64
+
65
+ begin
66
+ Base64.decode64(nonce_base64)
67
+ rescue Error
68
+ raise 'The provided "nonce_base64" is not Base64-encoded.'
69
+ end
70
+
71
+ @nonce_base64 = nonce_base64
72
+ end
73
+
74
+ #endregion
75
+
76
+ end
77
77
  end