pki_express 1.3.0 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +2 -2
- data/.github/workflows/test.yml +22 -0
- data/.gitignore +27 -27
- data/.rspec +1 -0
- data/CHANGELOG.md +19 -12
- data/Gemfile +9 -4
- data/README.md +24 -24
- data/Rakefile +7 -1
- data/lib/pki_express/auth_complete_result.rb +21 -21
- data/lib/pki_express/auth_start_result.rb +76 -76
- data/lib/pki_express/authentication.rb +284 -284
- data/lib/pki_express/base_signer.rb +54 -54
- data/lib/pki_express/cades_signature.rb +89 -89
- data/lib/pki_express/cades_signature_starter.rb +242 -242
- data/lib/pki_express/check_service_result.rb +15 -15
- data/lib/pki_express/command_error.rb +13 -13
- data/lib/pki_express/commands.rb +24 -24
- data/lib/pki_express/digest_algorithm.rb +118 -118
- data/lib/pki_express/digest_algorithm_and_value.rb +30 -30
- data/lib/pki_express/discovery_service_result.rb +25 -25
- data/lib/pki_express/enum.rb +9 -9
- data/lib/pki_express/error_codes.rb +46 -46
- data/lib/pki_express/installation_not_found_error.rb +8 -8
- data/lib/pki_express/name.rb +47 -47
- data/lib/pki_express/oids.rb +30 -30
- data/lib/pki_express/pades_certification_level.rb +7 -7
- data/lib/pki_express/pades_horizontal_align.rb +9 -9
- data/lib/pki_express/pades_measurement_units.rb +8 -8
- data/lib/pki_express/pades_page_optimization.rb +50 -50
- data/lib/pki_express/pades_page_orientation.rb +9 -9
- data/lib/pki_express/pades_paper_size.rb +21 -21
- data/lib/pki_express/pades_signature.rb +16 -16
- data/lib/pki_express/pades_signature_explorer.rb +30 -30
- data/lib/pki_express/pades_signature_starter.rb +251 -251
- data/lib/pki_express/pades_signer.rb +274 -274
- data/lib/pki_express/pades_signer_info.rb +9 -9
- data/lib/pki_express/pades_size.rb +17 -17
- data/lib/pki_express/pades_text_horizontal_align.rb +8 -8
- data/lib/pki_express/pades_vertical_align.rb +9 -9
- data/lib/pki_express/pades_visual_auto_positioning.rb +21 -21
- data/lib/pki_express/pades_visual_image.rb +51 -51
- data/lib/pki_express/pades_visual_manual_positioning.rb +16 -16
- data/lib/pki_express/pades_visual_positioning.rb +27 -27
- data/lib/pki_express/pades_visual_rectangle.rb +74 -74
- data/lib/pki_express/pades_visual_representation.rb +22 -22
- data/lib/pki_express/pades_visual_text.rb +35 -35
- data/lib/pki_express/pk_algorithms.rb +157 -157
- data/lib/pki_express/pk_certificate.rb +61 -61
- data/lib/pki_express/pki_brazil_certificate_fields.rb +57 -57
- data/lib/pki_express/pki_brazil_certificate_types.rb +19 -19
- data/lib/pki_express/pki_express_config.rb +39 -26
- data/lib/pki_express/pki_express_operator.rb +240 -234
- data/lib/pki_express/pki_italy_certificate_fields.rb +15 -15
- data/lib/pki_express/pki_italy_certificate_types.rb +11 -11
- data/lib/pki_express/signature_algorithm_and_value.rb +34 -34
- data/lib/pki_express/signature_explorer.rb +74 -74
- data/lib/pki_express/signature_finisher.rb +314 -314
- data/lib/pki_express/signature_policy_identifier.rb +20 -20
- data/lib/pki_express/signature_start_result.rb +12 -12
- data/lib/pki_express/signature_starter.rb +116 -116
- data/lib/pki_express/signer.rb +151 -151
- data/lib/pki_express/standard_signature_policies.rb +58 -58
- data/lib/pki_express/timestamp_authority.rb +50 -50
- data/lib/pki_express/trust_service_auth_parameters.rb +20 -20
- data/lib/pki_express/trust_service_info.rb +37 -37
- data/lib/pki_express/trust_service_manager.rb +258 -258
- data/lib/pki_express/trust_service_session_result.rb +29 -29
- data/lib/pki_express/trust_service_session_types.rb +7 -7
- data/lib/pki_express/tsa_authentication_type.rb +14 -14
- data/lib/pki_express/validation_error.rb +8 -8
- data/lib/pki_express/validation_item.rb +43 -43
- data/lib/pki_express/validation_item_types.rb +103 -103
- data/lib/pki_express/validation_results.rb +120 -120
- data/lib/pki_express/version.rb +3 -3
- data/lib/pki_express/version_manager.rb +20 -20
- data/lib/pki_express.rb +69 -69
- data/pki_express.gemspec +26 -26
- data/spec/pki_express/pki_express_config_spec.rb +73 -0
- data/spec/pki_express/pki_express_operator_spec.rb +31 -0
- data/spec/spec_helper.rb +13 -0
- metadata +17 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d86c8e5e27501e0d6b4190e3ef39a4924a15a9c2df9beeca64e6471d126af4a
|
4
|
+
data.tar.gz: d456aa97640505edf6e022ce259e106667f955a48e5847645f61051441578bef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -0,0 +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
|
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/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,19 @@
|
|
1
|
-
## 1.3.
|
2
|
-
*
|
3
|
-
|
4
|
-
## 1.
|
5
|
-
*
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
* Adds
|
10
|
-
|
11
|
-
## 1.
|
12
|
-
*
|
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,4 +1,9 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify the gem's dependencies in pki_express.gemspec
|
4
|
-
gemspec
|
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'
|
9
|
+
end
|
data/README.md
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
PKI Express for Ruby
|
2
|
-
============================
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/
|
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.
|
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,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
|