79
79
def verify(self, content, testament):
80
80
return SIGNATURE_VALID, None
82
def set_acceptable_keys(self, key_patterns):
83
patterns = key_patterns.split(",")
84
self.acceptable_keys = []
85
for pattern in patterns:
86
if pattern == "unknown":
89
self.acceptable_keys.append(pattern)
82
def set_acceptable_keys(self, command_line_input):
83
if command_line_input is not None:
84
patterns = command_line_input.split(",")
85
self.acceptable_keys = []
86
for pattern in patterns:
87
if pattern == "unknown":
90
self.acceptable_keys.append(pattern)
92
93
def _set_gpg_tty():
209
210
raise errors.SignatureVerificationFailed("Unknown GnuPG key "\
210
211
"verification result")
212
def set_acceptable_keys(self, key_patterns):
213
patterns = key_patterns.split(",")
215
self.acceptable_keys = []
216
for pattern in patterns:
217
result = self.context.keylist(pattern)
221
self.acceptable_keys.append(key.subkeys[0].fpr)
222
trace.mutter("Added acceptable key: " + key.subkeys[0].fpr)
224
trace.note(i18n.gettext(
225
"No GnuPG key results for pattern: {}"
213
def set_acceptable_keys(self, command_line_input):
214
"""sets the acceptable keys for verifying with this GPGStrategy
216
:param command_line_input: comma separated list of patterns from
221
acceptable_keys_config = self._config.acceptable_keys()
223
if isinstance(acceptable_keys_config, unicode):
224
acceptable_keys_config = str(acceptable_keys_config)
225
except UnicodeEncodeError:
226
raise errors.BzrCommandError('Only ASCII permitted in option names')
228
if acceptable_keys_config is not None:
229
key_patterns = acceptable_keys_config
230
if command_line_input is not None: #command line overrides config
231
key_patterns = command_line_input
232
if key_patterns is not None:
233
patterns = key_patterns.split(",")
235
self.acceptable_keys = []
236
for pattern in patterns:
237
result = self.context.keylist(pattern)
241
self.acceptable_keys.append(key.subkeys[0].fpr)
242
trace.mutter("Added acceptable key: " + key.subkeys[0].fpr)
244
trace.note(i18n.gettext(
245
"No GnuPG key results for pattern: {}"