pki_express 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,51 +1,51 @@
1
- module PkiExpress
2
- class TimestampAuthority
3
- attr_reader :url, :token, :ssl_thumbprint, :basic_auth, :auth_type
4
-
5
- def initialize(url)
6
- @url = url
7
- @auth_type = TsaAuthenticationType::NONE
8
- @token = nil
9
- @ssl_thumbprint = nil
10
- @basic_auth = nil
11
- end
12
-
13
- def set_oauth_token_authentication(token)
14
- @token = token
15
- @auth_type = TsaAuthenticationType::OAUTH_TOKEN
16
- end
17
-
18
- def set_basic_authentication(username, password)
19
- @basic_auth = "#{username}:#{password}"
20
- @auth_type = TsaAuthenticationType::BASIC_AUTH
21
- end
22
-
23
- def set_ssl_thumbprint(ssl_thumbprint)
24
- @ssl_thumbprint = ssl_thumbprint
25
- @auth_type = TsaAuthenticationType::SSL
26
- end
27
-
28
- def get_cmd_arguments
29
- args = []
30
- args.append('--tsa-url')
31
- args.append(url)
32
-
33
- case auth_type
34
- when TsaAuthenticationType::NONE
35
- when TsaAuthenticationType::BASIC_AUTH
36
- args.append('--tsa-basic-auth')
37
- args.append(@basic_auth)
38
- when TsaAuthenticationType::SSL
39
- args.append('--tsa-ssl-thumbprint')
40
- args.append(@ssl_thumbprint)
41
- when TsaAuthenticationType::OAUTH_TOKEN
42
- args.append('--tsa-token')
43
- args.append(token)
44
- else
45
- raise 'Unknown authentication type of the timestamp authority'
46
- end
47
-
48
- args
49
- end
50
- end
1
+ module PkiExpress
2
+ class TimestampAuthority
3
+ attr_reader :url, :token, :ssl_thumbprint, :basic_auth, :auth_type
4
+
5
+ def initialize(url)
6
+ @url = url
7
+ @auth_type = TsaAuthenticationType::NONE
8
+ @token = nil
9
+ @ssl_thumbprint = nil
10
+ @basic_auth = nil
11
+ end
12
+
13
+ def set_oauth_token_authentication(token)
14
+ @token = token
15
+ @auth_type = TsaAuthenticationType::OAUTH_TOKEN
16
+ end
17
+
18
+ def set_basic_authentication(username, password)
19
+ @basic_auth = "#{username}:#{password}"
20
+ @auth_type = TsaAuthenticationType::BASIC_AUTH
21
+ end
22
+
23
+ def set_ssl_thumbprint(ssl_thumbprint)
24
+ @ssl_thumbprint = ssl_thumbprint
25
+ @auth_type = TsaAuthenticationType::SSL
26
+ end
27
+
28
+ def get_cmd_arguments
29
+ args = []
30
+ args.append('--tsa-url')
31
+ args.append(url)
32
+
33
+ case auth_type
34
+ when TsaAuthenticationType::NONE
35
+ when TsaAuthenticationType::BASIC_AUTH
36
+ args.append('--tsa-basic-auth')
37
+ args.append(@basic_auth)
38
+ when TsaAuthenticationType::SSL
39
+ args.append('--tsa-ssl-thumbprint')
40
+ args.append(@ssl_thumbprint)
41
+ when TsaAuthenticationType::OAUTH_TOKEN
42
+ args.append('--tsa-token')
43
+ args.append(token)
44
+ else
45
+ raise 'Unknown authentication type of the timestamp authority'
46
+ end
47
+
48
+ args
49
+ end
50
+ end
51
51
  end
@@ -1,21 +1,21 @@
1
- module PkiExpress
2
-
3
- class TrustServiceAuthParameters
4
- attr_accessor :service_info, :auth_url
5
-
6
- def initialize(model)
7
- @service_info = nil
8
- @auth_url = nil
9
-
10
- unless model.nil?
11
- @auth_url = model.fetch(:authUrl)
12
-
13
- service_info = model.fetch(:serviceInfo)
14
- if service_info
15
- @service_info = TrustServiceInfo.new(service_info)
16
- end
17
- end
18
- end
19
-
20
- end
1
+ module PkiExpress
2
+
3
+ class TrustServiceAuthParameters
4
+ attr_accessor :service_info, :auth_url
5
+
6
+ def initialize(model)
7
+ @service_info = nil
8
+ @auth_url = nil
9
+
10
+ unless model.nil?
11
+ @auth_url = model.fetch(:authUrl)
12
+
13
+ service_info = model.fetch(:serviceInfo)
14
+ if service_info
15
+ @service_info = TrustServiceInfo.new(service_info)
16
+ end
17
+ end
18
+ end
19
+
20
+ end
21
21
  end
@@ -1,38 +1,38 @@
1
- module PkiExpress
2
-
3
- class TrustServiceInfo
4
-
5
- attr_accessor :service, :provider, :badge_url
6
-
7
- def initialize(model)
8
- @service = nil
9
- @provider = nil
10
- @badge_url = nil
11
-
12
- unless model.nil?
13
- @provider = model.fetch(:provider)
14
- @badge_url = model.fetch(:badgeUrl)
15
-
16
- service = model.fetch(:service)
17
- if service
18
- @service = TrustServiceName.new(service)
19
- end
20
- end
21
- end
22
-
23
- end
24
-
25
- class TrustServiceName
26
-
27
- attr_accessor :name
28
-
29
- def initialize(model)
30
- @name = nil
31
-
32
- unless model.nil?
33
- @name = model.fetch(:name)
34
- end
35
- end
36
-
37
- end
1
+ module PkiExpress
2
+
3
+ class TrustServiceInfo
4
+
5
+ attr_accessor :service, :provider, :badge_url
6
+
7
+ def initialize(model)
8
+ @service = nil
9
+ @provider = nil
10
+ @badge_url = nil
11
+
12
+ unless model.nil?
13
+ @provider = model.fetch(:provider)
14
+ @badge_url = model.fetch(:badgeUrl)
15
+
16
+ service = model.fetch(:service)
17
+ if service
18
+ @service = TrustServiceName.new(service)
19
+ end
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ class TrustServiceName
26
+
27
+ attr_accessor :name
28
+
29
+ def initialize(model)
30
+ @name = nil
31
+
32
+ unless model.nil?
33
+ @name = model.fetch(:name)
34
+ end
35
+ end
36
+
37
+ end
38
38
  end