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
@@ -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
|