ruby_gpg2 0.9.0.pre.6 → 0.9.0.pre.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +50 -13
- data/Rakefile +83 -46
- data/bin/console +4 -3
- data/lib/ruby_gpg2/colon_output.rb +61 -42
- data/lib/ruby_gpg2/colon_record.rb +257 -222
- data/lib/ruby_gpg2/commands/base.rb +9 -13
- data/lib/ruby_gpg2/commands/decrypt.rb +3 -2
- data/lib/ruby_gpg2/commands/encrypt.rb +3 -2
- data/lib/ruby_gpg2/commands/export.rb +2 -0
- data/lib/ruby_gpg2/commands/export_secret_keys.rb +2 -0
- data/lib/ruby_gpg2/commands/generate_key.rb +5 -1
- data/lib/ruby_gpg2/commands/import.rb +2 -0
- data/lib/ruby_gpg2/commands/list_public_keys.rb +3 -2
- data/lib/ruby_gpg2/commands/list_secret_keys.rb +3 -2
- data/lib/ruby_gpg2/commands/mixins/armor_config.rb +2 -0
- data/lib/ruby_gpg2/commands/mixins/batch_config.rb +2 -0
- data/lib/ruby_gpg2/commands/mixins/colon_config.rb +2 -0
- data/lib/ruby_gpg2/commands/mixins/global_config.rb +7 -2
- data/lib/ruby_gpg2/commands/mixins/input_config.rb +2 -0
- data/lib/ruby_gpg2/commands/mixins/output_config.rb +7 -2
- data/lib/ruby_gpg2/commands/mixins/passphrase_config.rb +7 -2
- data/lib/ruby_gpg2/commands/mixins/pinentry_config.rb +7 -2
- data/lib/ruby_gpg2/commands/mixins/recipient_config.rb +7 -2
- data/lib/ruby_gpg2/commands/mixins/status_config.rb +7 -2
- data/lib/ruby_gpg2/commands/mixins/trust_mode_config.rb +7 -2
- data/lib/ruby_gpg2/commands/mixins/with_captured_output.rb +10 -5
- data/lib/ruby_gpg2/commands/mixins/with_captured_status.rb +11 -7
- data/lib/ruby_gpg2/commands/mixins/with_result.rb +2 -0
- data/lib/ruby_gpg2/commands/mixins/without_passphrase.rb +8 -3
- data/lib/ruby_gpg2/commands/result.rb +3 -3
- data/lib/ruby_gpg2/commands.rb +3 -2
- data/lib/ruby_gpg2/key.rb +34 -25
- data/lib/ruby_gpg2/parameter_file_contents.rb +101 -51
- data/lib/ruby_gpg2/status_line.rb +15 -12
- data/lib/ruby_gpg2/status_lines/import_ok.rb +29 -25
- data/lib/ruby_gpg2/status_lines/import_problem.rb +19 -15
- data/lib/ruby_gpg2/status_lines/imported.rb +13 -9
- data/lib/ruby_gpg2/status_lines/key_considered.rb +18 -14
- data/lib/ruby_gpg2/status_lines/key_created.rb +20 -16
- data/lib/ruby_gpg2/status_lines/unimplemented.rb +6 -3
- data/lib/ruby_gpg2/status_lines.rb +2 -1
- data/lib/ruby_gpg2/status_output.rb +2 -0
- data/lib/ruby_gpg2/user_id.rb +19 -16
- data/lib/ruby_gpg2/version.rb +3 -1
- data/lib/ruby_gpg2.rb +2 -0
- data/ruby_gpg2.gemspec +55 -0
- metadata +64 -6
@@ -1,154 +1,129 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'date'
|
2
4
|
|
3
5
|
module RubyGPG2
|
6
|
+
# rubocop:disable Metrics/ClassLength
|
4
7
|
class ColonRecord
|
5
|
-
USER_ID_REGEX = /^(.*?) (?:\((.*)\) )?<(.*)
|
8
|
+
USER_ID_REGEX = /^(.*?) (?:\((.*)\) )?<(.*)>$/.freeze
|
6
9
|
|
7
10
|
TYPES = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
}
|
11
|
+
'pub' => :public_key,
|
12
|
+
'crt' => :x509_certificate,
|
13
|
+
'crs' => :x509_certificate_and_private_key,
|
14
|
+
'sub' => :sub_key,
|
15
|
+
'sec' => :secret_key,
|
16
|
+
'ssb' => :secret_sub_key,
|
17
|
+
'uid' => :user_id,
|
18
|
+
'uat' => :user_attribute,
|
19
|
+
'sig' => :signature,
|
20
|
+
'rev' => :revocation_signature,
|
21
|
+
'rvs' => :standalone_revocation_signature,
|
22
|
+
'fpr' => :fingerprint,
|
23
|
+
'pkd' => :public_key_data,
|
24
|
+
'grp' => :key_grip,
|
25
|
+
'rvk' => :revocation_key,
|
26
|
+
'tfs' => :tofu_statistics,
|
27
|
+
'tru' => :trust_database_information,
|
28
|
+
'spk' => :signature_sub_packet,
|
29
|
+
'cfg' => :configuration_data
|
30
|
+
}.freeze
|
28
31
|
|
29
32
|
TRUST_MODELS = {
|
30
|
-
|
31
|
-
|
32
|
-
}
|
33
|
+
'0' => :classic,
|
34
|
+
'1' => :pgp
|
35
|
+
}.freeze
|
33
36
|
|
34
37
|
VALIDITIES = {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
38
|
+
'o' => :unknown_new_key,
|
39
|
+
'i' => :invalid,
|
40
|
+
'd' => :disabled,
|
41
|
+
'r' => :revoked,
|
42
|
+
'e' => :expired,
|
43
|
+
'-' => :unknown,
|
44
|
+
'q' => :undefined,
|
45
|
+
'n' => :never,
|
46
|
+
'm' => :marginal,
|
47
|
+
'f' => :full,
|
48
|
+
'u' => :ultimate,
|
49
|
+
'w' => :well_known_private,
|
50
|
+
's' => :special
|
51
|
+
}.freeze
|
49
52
|
|
50
53
|
KEY_ALGORITHMS = {
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
}
|
54
|
+
'1' => :rsa_encrypt_or_sign,
|
55
|
+
'2' => :rsa_encrypt_only,
|
56
|
+
'3' => :rsa_sign_only,
|
57
|
+
'16' => :elgamal_encrypt_only,
|
58
|
+
'17' => :dsa,
|
59
|
+
'18' => :ecdh,
|
60
|
+
'19' => :ecdsa
|
61
|
+
}.freeze
|
59
62
|
|
60
63
|
TRUSTS = {
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
}
|
64
|
+
'-' => :unknown,
|
65
|
+
'n' => :never,
|
66
|
+
'm' => :marginal,
|
67
|
+
'f' => :full,
|
68
|
+
'u' => :ultimate
|
69
|
+
}.freeze
|
67
70
|
|
68
71
|
KEY_CAPABILITIES = {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
}
|
72
|
+
'e' => :encrypt,
|
73
|
+
's' => :sign,
|
74
|
+
'c' => :certify,
|
75
|
+
'a' => :authenticate,
|
76
|
+
'E' => :primary_encrypt,
|
77
|
+
'S' => :primary_sign,
|
78
|
+
'C' => :primary_certify,
|
79
|
+
'A' => :primary_authenticate,
|
80
|
+
'?' => :unknown
|
81
|
+
}.freeze
|
79
82
|
|
80
83
|
COMPLIANCE_MODES = {
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
}
|
84
|
+
'8' => :rfc_4880bis,
|
85
|
+
'23' => :de_vs,
|
86
|
+
'6001' => :roca_screening_hit
|
87
|
+
}.freeze
|
85
88
|
|
86
89
|
def self.parse(record)
|
87
90
|
fields = record.split(':', 22)
|
88
91
|
type = type(fields[0])
|
89
|
-
|
90
|
-
|
91
|
-
new(
|
92
|
-
raw: record,
|
93
|
-
type: type,
|
94
|
-
trust_model: trust_model(fields[2]),
|
95
|
-
creation_date: creation_date(fields[3]),
|
96
|
-
expiration_date: expiration_date(fields[4]),
|
97
|
-
new_key_signer_marginal_count:
|
98
|
-
new_key_signer_marginal_count(fields[5]),
|
99
|
-
new_key_signer_complete_count:
|
100
|
-
new_key_signer_complete_count(fields[6]),
|
101
|
-
maximum_certificate_chain_depth:
|
102
|
-
maximum_certificate_chain_depth(fields[7]))
|
92
|
+
if trust_base_record?(type)
|
93
|
+
make_trust_base_record(record, type, fields)
|
103
94
|
else
|
104
|
-
|
105
|
-
raw: record,
|
106
|
-
type: type,
|
107
|
-
validity: validity(fields[1]),
|
108
|
-
key_length: key_length(fields[2]),
|
109
|
-
key_algorithm: key_algorithm(fields[3]),
|
110
|
-
key_id: key_id(fields[4]),
|
111
|
-
creation_date: creation_date(fields[5]),
|
112
|
-
expiration_date: expiration_date(fields[6]),
|
113
|
-
user_id_hash: user_id_hash(type, fields[7]),
|
114
|
-
owner_trust: owner_trust(fields[8]),
|
115
|
-
fingerprint: fingerprint(type, fields[9]),
|
116
|
-
key_grip: key_grip(type, fields[9]),
|
117
|
-
user_id: user_id(type, fields[9]),
|
118
|
-
signature_class: signature_class(fields[10]),
|
119
|
-
key_capabilities: key_capabilities(fields[11]),
|
120
|
-
serial_number: serial_number(fields[14]),
|
121
|
-
compliance_modes: compliance_modes(fields[17]),
|
122
|
-
last_update: last_update(fields[18]),
|
123
|
-
origin: origin(fields[19]))
|
95
|
+
make_standard_record(record, type, fields)
|
124
96
|
end
|
125
97
|
end
|
126
98
|
|
127
99
|
attr_reader(
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
100
|
+
:raw,
|
101
|
+
:type,
|
102
|
+
:trust_model,
|
103
|
+
:validity,
|
104
|
+
:key_length,
|
105
|
+
:key_algorithm,
|
106
|
+
:key_id,
|
107
|
+
:creation_date,
|
108
|
+
:expiration_date,
|
109
|
+
:user_id_hash,
|
110
|
+
:owner_trust,
|
111
|
+
:fingerprint,
|
112
|
+
:key_grip,
|
113
|
+
:user_id,
|
114
|
+
:signature_class,
|
115
|
+
:key_capabilities,
|
116
|
+
:serial_number,
|
117
|
+
:compliance_modes,
|
118
|
+
:last_update,
|
119
|
+
:origin,
|
120
|
+
:new_key_signer_marginal_count,
|
121
|
+
:new_key_signer_complete_count,
|
122
|
+
:maximum_certificate_chain_depth
|
123
|
+
)
|
124
|
+
|
125
|
+
# rubocop:disable Metrics/MethodLength
|
126
|
+
# rubocop:disable Metrics/AbcSize
|
152
127
|
def initialize(opts)
|
153
128
|
@raw = opts[:raw]
|
154
129
|
@type = opts[:type]
|
@@ -174,6 +149,8 @@ module RubyGPG2
|
|
174
149
|
@new_key_signer_complete_count = opts[:new_key_signer_complete_count]
|
175
150
|
@maximum_certificate_chain_depth = opts[:maximum_certificate_chain_depth]
|
176
151
|
end
|
152
|
+
# rubocop:enable Metrics/AbcSize
|
153
|
+
# rubocop:enable Metrics/MethodLength
|
177
154
|
|
178
155
|
def fingerprint_record?
|
179
156
|
type == :fingerprint
|
@@ -184,21 +161,24 @@ module RubyGPG2
|
|
184
161
|
end
|
185
162
|
|
186
163
|
def user_name
|
187
|
-
|
188
|
-
|
189
|
-
|
164
|
+
match = user_id&.match(USER_ID_REGEX)
|
165
|
+
return unless match
|
166
|
+
|
167
|
+
match[1]
|
190
168
|
end
|
191
169
|
|
192
170
|
def user_comment
|
193
|
-
|
194
|
-
|
195
|
-
|
171
|
+
match = user_id&.match(USER_ID_REGEX)
|
172
|
+
return unless match
|
173
|
+
|
174
|
+
match[2]
|
196
175
|
end
|
197
176
|
|
198
177
|
def user_email
|
199
|
-
|
200
|
-
|
201
|
-
|
178
|
+
match = user_id&.match(USER_ID_REGEX)
|
179
|
+
return unless match
|
180
|
+
|
181
|
+
match[3]
|
202
182
|
end
|
203
183
|
|
204
184
|
def ==(other)
|
@@ -207,124 +187,179 @@ module RubyGPG2
|
|
207
187
|
|
208
188
|
protected
|
209
189
|
|
190
|
+
# rubocop:disable Metrics/MethodLength
|
210
191
|
def state
|
211
192
|
[
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
193
|
+
@raw,
|
194
|
+
@type,
|
195
|
+
@trust_model,
|
196
|
+
@validity,
|
197
|
+
@key_length,
|
198
|
+
@key_algorithm,
|
199
|
+
@key_id,
|
200
|
+
@creation_date,
|
201
|
+
@expiration_date,
|
202
|
+
@user_id_hash,
|
203
|
+
@owner_trust,
|
204
|
+
@fingerprint,
|
205
|
+
@key_grip,
|
206
|
+
@user_id,
|
207
|
+
@signature_class,
|
208
|
+
@key_capabilities,
|
209
|
+
@serial_number,
|
210
|
+
@compliance_modes,
|
211
|
+
@last_update,
|
212
|
+
@origin,
|
213
|
+
@new_key_signer_marginal_count,
|
214
|
+
@new_key_signer_complete_count,
|
215
|
+
@maximum_certificate_chain_depth
|
235
216
|
]
|
236
217
|
end
|
218
|
+
# rubocop:enable Metrics/MethodLength
|
237
219
|
|
238
|
-
|
220
|
+
class << self
|
221
|
+
protected
|
239
222
|
|
240
|
-
|
241
|
-
|
242
|
-
|
223
|
+
# rubocop:disable Metrics/MethodLength
|
224
|
+
# rubocop:disable Metrics/AbcSize
|
225
|
+
def make_standard_record(record, type, fields)
|
226
|
+
new(
|
227
|
+
raw: record,
|
228
|
+
type: type,
|
229
|
+
validity: validity(fields[1]),
|
230
|
+
key_length: key_length(fields[2]),
|
231
|
+
key_algorithm: key_algorithm(fields[3]),
|
232
|
+
key_id: key_id(fields[4]),
|
233
|
+
creation_date: creation_date(fields[5]),
|
234
|
+
expiration_date: expiration_date(fields[6]),
|
235
|
+
user_id_hash: user_id_hash(type, fields[7]),
|
236
|
+
owner_trust: owner_trust(fields[8]),
|
237
|
+
fingerprint: fingerprint(type, fields[9]),
|
238
|
+
key_grip: key_grip(type, fields[9]),
|
239
|
+
user_id: user_id(type, fields[9]),
|
240
|
+
signature_class: signature_class(fields[10]),
|
241
|
+
key_capabilities: key_capabilities(fields[11]),
|
242
|
+
serial_number: serial_number(fields[14]),
|
243
|
+
compliance_modes: compliance_modes(fields[17]),
|
244
|
+
last_update: last_update(fields[18]),
|
245
|
+
origin: origin(fields[19])
|
246
|
+
)
|
247
|
+
end
|
248
|
+
# rubocop:enable Metrics/AbcSize
|
249
|
+
# rubocop:enable Metrics/MethodLength
|
243
250
|
|
244
|
-
|
245
|
-
|
246
|
-
|
251
|
+
# rubocop:disable Metrics/MethodLength
|
252
|
+
def make_trust_base_record(record, type, fields)
|
253
|
+
new(
|
254
|
+
raw: record,
|
255
|
+
type: type,
|
256
|
+
trust_model: trust_model(fields[2]),
|
257
|
+
creation_date: creation_date(fields[3]),
|
258
|
+
expiration_date: expiration_date(fields[4]),
|
259
|
+
new_key_signer_marginal_count:
|
260
|
+
new_key_signer_marginal_count(fields[5]),
|
261
|
+
new_key_signer_complete_count:
|
262
|
+
new_key_signer_complete_count(fields[6]),
|
263
|
+
maximum_certificate_chain_depth:
|
264
|
+
maximum_certificate_chain_depth(fields[7])
|
265
|
+
)
|
266
|
+
end
|
267
|
+
# rubocop:enable Metrics/MethodLength
|
247
268
|
|
248
|
-
|
249
|
-
|
250
|
-
|
269
|
+
def trust_base_record?(type)
|
270
|
+
type == :trust_database_information
|
271
|
+
end
|
251
272
|
|
252
|
-
|
253
|
-
|
254
|
-
|
273
|
+
def type(value)
|
274
|
+
TYPES[value]
|
275
|
+
end
|
255
276
|
|
256
|
-
|
257
|
-
|
258
|
-
|
277
|
+
def trust_model(value)
|
278
|
+
TRUST_MODELS[value]
|
279
|
+
end
|
259
280
|
|
260
|
-
|
261
|
-
|
262
|
-
|
281
|
+
def validity(value)
|
282
|
+
VALIDITIES[value]
|
283
|
+
end
|
263
284
|
|
264
|
-
|
265
|
-
|
266
|
-
|
285
|
+
def key_length(value)
|
286
|
+
value =~ /\d+/ ? value.to_s.to_i : nil
|
287
|
+
end
|
267
288
|
|
268
|
-
|
269
|
-
|
270
|
-
|
289
|
+
def key_algorithm(value)
|
290
|
+
KEY_ALGORITHMS[value]
|
291
|
+
end
|
271
292
|
|
272
|
-
|
273
|
-
|
274
|
-
|
293
|
+
def key_id(value)
|
294
|
+
value =~ /.+/ ? value : nil
|
295
|
+
end
|
275
296
|
|
276
|
-
|
277
|
-
|
278
|
-
|
297
|
+
def creation_date(value)
|
298
|
+
value =~ /\d+/ ? DateTime.strptime(value, '%s') : nil
|
299
|
+
end
|
279
300
|
|
280
|
-
|
281
|
-
|
282
|
-
|
301
|
+
def expiration_date(value)
|
302
|
+
value =~ /\d+/ ? DateTime.strptime(value, '%s') : nil
|
303
|
+
end
|
283
304
|
|
284
|
-
|
285
|
-
|
286
|
-
|
305
|
+
def user_id_hash(type, value)
|
306
|
+
type == :user_id ? value : nil
|
307
|
+
end
|
308
|
+
|
309
|
+
def owner_trust(value)
|
310
|
+
TRUSTS[value]
|
311
|
+
end
|
312
|
+
|
313
|
+
def fingerprint(type, value)
|
314
|
+
type == :fingerprint ? value : nil
|
315
|
+
end
|
316
|
+
|
317
|
+
def key_grip(type, value)
|
318
|
+
type == :key_grip ? value : nil
|
319
|
+
end
|
320
|
+
|
321
|
+
def user_id(type, value)
|
322
|
+
return if %i[fingerprint key_grip].include?(type)
|
287
323
|
|
288
|
-
def self.user_id(type, value)
|
289
|
-
unless [:fingerprint, :key_grip].include?(type)
|
290
324
|
value =~ /.+/ ? value : nil
|
291
325
|
end
|
292
|
-
end
|
293
326
|
|
294
|
-
|
295
|
-
|
296
|
-
|
327
|
+
def signature_class(value)
|
328
|
+
value =~ /.+/ ? value : nil
|
329
|
+
end
|
297
330
|
|
298
|
-
|
299
|
-
|
300
|
-
|
331
|
+
def key_capabilities(value)
|
332
|
+
value =~ /.+/ ? value.chars.map { |c| KEY_CAPABILITIES[c] } : nil
|
333
|
+
end
|
301
334
|
|
302
|
-
|
303
|
-
|
304
|
-
|
335
|
+
def serial_number(value)
|
336
|
+
value =~ /.+/ ? value : nil
|
337
|
+
end
|
305
338
|
|
306
|
-
|
307
|
-
|
308
|
-
|
339
|
+
def compliance_modes(value)
|
340
|
+
value =~ /.+/ ? value.split.map { |m| COMPLIANCE_MODES[m] } : nil
|
341
|
+
end
|
309
342
|
|
310
|
-
|
311
|
-
|
312
|
-
|
343
|
+
def last_update(value)
|
344
|
+
value =~ /\d+/ ? DateTime.strptime(value, '%s') : nil
|
345
|
+
end
|
313
346
|
|
314
|
-
|
315
|
-
|
316
|
-
|
347
|
+
def origin(value)
|
348
|
+
value
|
349
|
+
end
|
317
350
|
|
318
|
-
|
319
|
-
|
320
|
-
|
351
|
+
def new_key_signer_marginal_count(value)
|
352
|
+
value =~ /\d+/ ? value.to_i : nil
|
353
|
+
end
|
321
354
|
|
322
|
-
|
323
|
-
|
324
|
-
|
355
|
+
def new_key_signer_complete_count(value)
|
356
|
+
value =~ /\d+/ ? value.to_i : nil
|
357
|
+
end
|
325
358
|
|
326
|
-
|
327
|
-
|
359
|
+
def maximum_certificate_chain_depth(value)
|
360
|
+
value =~ /\d+/ ? value.to_i : nil
|
361
|
+
end
|
328
362
|
end
|
329
363
|
end
|
364
|
+
# rubocop:enable Metrics/ClassLength
|
330
365
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lino'
|
2
4
|
|
3
5
|
require_relative './result'
|
@@ -13,17 +15,12 @@ module RubyGPG2
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def execute(opts = {})
|
16
|
-
builder = instantiate_builder
|
17
|
-
|
18
18
|
do_before(opts)
|
19
19
|
do_around(opts) do |updated_opts|
|
20
|
-
builder = configure_command(
|
20
|
+
builder = configure_command(instantiate_builder, updated_opts)
|
21
21
|
builder
|
22
|
-
|
23
|
-
|
24
|
-
stdin: stdin,
|
25
|
-
stdout: stdout,
|
26
|
-
stderr: stderr)
|
22
|
+
.build
|
23
|
+
.execute(stdin: stdin, stdout: stdout, stderr: stderr)
|
27
24
|
end
|
28
25
|
do_after(opts)
|
29
26
|
end
|
@@ -34,13 +31,12 @@ module RubyGPG2
|
|
34
31
|
|
35
32
|
def instantiate_builder
|
36
33
|
Lino::CommandLineBuilder
|
37
|
-
|
34
|
+
.for_command(binary)
|
38
35
|
end
|
39
36
|
|
40
|
-
def do_before(
|
41
|
-
end
|
37
|
+
def do_before(_); end
|
42
38
|
|
43
|
-
def configure_command(builder,
|
39
|
+
def configure_command(builder, _opts)
|
44
40
|
builder
|
45
41
|
end
|
46
42
|
|
@@ -48,7 +44,7 @@ module RubyGPG2
|
|
48
44
|
yield opts
|
49
45
|
end
|
50
46
|
|
51
|
-
def do_after(
|
47
|
+
def do_after(_)
|
52
48
|
Result.new
|
53
49
|
end
|
54
50
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lino'
|
2
4
|
|
3
5
|
require_relative 'base'
|
@@ -24,8 +26,7 @@ module RubyGPG2
|
|
24
26
|
|
25
27
|
def configure_command(builder, opts)
|
26
28
|
builder = super(builder, opts)
|
27
|
-
builder
|
28
|
-
builder
|
29
|
+
builder.with_subcommand('--decrypt')
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lino'
|
2
4
|
|
3
5
|
require_relative 'base'
|
@@ -22,8 +24,7 @@ module RubyGPG2
|
|
22
24
|
|
23
25
|
def configure_command(builder, opts)
|
24
26
|
builder = super(builder, opts)
|
25
|
-
builder
|
26
|
-
builder
|
27
|
+
builder.with_subcommand('--encrypt')
|
27
28
|
end
|
28
29
|
end
|
29
30
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lino'
|
2
4
|
|
3
5
|
require_relative 'base'
|
@@ -27,7 +29,9 @@ module RubyGPG2
|
|
27
29
|
|
28
30
|
builder = builder.with_subcommand('--generate-key')
|
29
31
|
builder = super(builder, opts)
|
30
|
-
|
32
|
+
if parameter_file_path
|
33
|
+
builder = builder.with_argument(parameter_file_path)
|
34
|
+
end
|
31
35
|
builder
|
32
36
|
end
|
33
37
|
end
|