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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +2 -2
  3. data/.github/workflows/test.yml +22 -0
  4. data/.gitignore +27 -27
  5. data/.rspec +1 -0
  6. data/CHANGELOG.md +19 -12
  7. data/Gemfile +9 -4
  8. data/README.md +24 -24
  9. data/Rakefile +7 -1
  10. data/lib/pki_express/auth_complete_result.rb +21 -21
  11. data/lib/pki_express/auth_start_result.rb +76 -76
  12. data/lib/pki_express/authentication.rb +284 -284
  13. data/lib/pki_express/base_signer.rb +54 -54
  14. data/lib/pki_express/cades_signature.rb +89 -89
  15. data/lib/pki_express/cades_signature_starter.rb +242 -242
  16. data/lib/pki_express/check_service_result.rb +15 -15
  17. data/lib/pki_express/command_error.rb +13 -13
  18. data/lib/pki_express/commands.rb +24 -24
  19. data/lib/pki_express/digest_algorithm.rb +118 -118
  20. data/lib/pki_express/digest_algorithm_and_value.rb +30 -30
  21. data/lib/pki_express/discovery_service_result.rb +25 -25
  22. data/lib/pki_express/enum.rb +9 -9
  23. data/lib/pki_express/error_codes.rb +46 -46
  24. data/lib/pki_express/installation_not_found_error.rb +8 -8
  25. data/lib/pki_express/name.rb +47 -47
  26. data/lib/pki_express/oids.rb +30 -30
  27. data/lib/pki_express/pades_certification_level.rb +7 -7
  28. data/lib/pki_express/pades_horizontal_align.rb +9 -9
  29. data/lib/pki_express/pades_measurement_units.rb +8 -8
  30. data/lib/pki_express/pades_page_optimization.rb +50 -50
  31. data/lib/pki_express/pades_page_orientation.rb +9 -9
  32. data/lib/pki_express/pades_paper_size.rb +21 -21
  33. data/lib/pki_express/pades_signature.rb +16 -16
  34. data/lib/pki_express/pades_signature_explorer.rb +30 -30
  35. data/lib/pki_express/pades_signature_starter.rb +251 -251
  36. data/lib/pki_express/pades_signer.rb +274 -274
  37. data/lib/pki_express/pades_signer_info.rb +9 -9
  38. data/lib/pki_express/pades_size.rb +17 -17
  39. data/lib/pki_express/pades_text_horizontal_align.rb +8 -8
  40. data/lib/pki_express/pades_vertical_align.rb +9 -9
  41. data/lib/pki_express/pades_visual_auto_positioning.rb +21 -21
  42. data/lib/pki_express/pades_visual_image.rb +51 -51
  43. data/lib/pki_express/pades_visual_manual_positioning.rb +16 -16
  44. data/lib/pki_express/pades_visual_positioning.rb +27 -27
  45. data/lib/pki_express/pades_visual_rectangle.rb +74 -74
  46. data/lib/pki_express/pades_visual_representation.rb +22 -22
  47. data/lib/pki_express/pades_visual_text.rb +35 -35
  48. data/lib/pki_express/pk_algorithms.rb +157 -157
  49. data/lib/pki_express/pk_certificate.rb +61 -61
  50. data/lib/pki_express/pki_brazil_certificate_fields.rb +57 -57
  51. data/lib/pki_express/pki_brazil_certificate_types.rb +19 -19
  52. data/lib/pki_express/pki_express_config.rb +39 -26
  53. data/lib/pki_express/pki_express_operator.rb +240 -234
  54. data/lib/pki_express/pki_italy_certificate_fields.rb +15 -15
  55. data/lib/pki_express/pki_italy_certificate_types.rb +11 -11
  56. data/lib/pki_express/signature_algorithm_and_value.rb +34 -34
  57. data/lib/pki_express/signature_explorer.rb +74 -74
  58. data/lib/pki_express/signature_finisher.rb +314 -314
  59. data/lib/pki_express/signature_policy_identifier.rb +20 -20
  60. data/lib/pki_express/signature_start_result.rb +12 -12
  61. data/lib/pki_express/signature_starter.rb +116 -116
  62. data/lib/pki_express/signer.rb +151 -151
  63. data/lib/pki_express/standard_signature_policies.rb +58 -58
  64. data/lib/pki_express/timestamp_authority.rb +50 -50
  65. data/lib/pki_express/trust_service_auth_parameters.rb +20 -20
  66. data/lib/pki_express/trust_service_info.rb +37 -37
  67. data/lib/pki_express/trust_service_manager.rb +258 -258
  68. data/lib/pki_express/trust_service_session_result.rb +29 -29
  69. data/lib/pki_express/trust_service_session_types.rb +7 -7
  70. data/lib/pki_express/tsa_authentication_type.rb +14 -14
  71. data/lib/pki_express/validation_error.rb +8 -8
  72. data/lib/pki_express/validation_item.rb +43 -43
  73. data/lib/pki_express/validation_item_types.rb +103 -103
  74. data/lib/pki_express/validation_results.rb +120 -120
  75. data/lib/pki_express/version.rb +3 -3
  76. data/lib/pki_express/version_manager.rb +20 -20
  77. data/lib/pki_express.rb +69 -69
  78. data/pki_express.gemspec +26 -26
  79. data/spec/pki_express/pki_express_config_spec.rb +73 -0
  80. data/spec/pki_express/pki_express_operator_spec.rb +31 -0
  81. data/spec/spec_helper.rb +13 -0
  82. metadata +17 -9
@@ -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