def setKey(self, key):
self._key = None
try:
if key is not None:
self.aes_input.text = key
k = utils.loadB64Key(key.encode('utf-8'))
if self._algorithmPrefix not in algorithms.ALGORITHMS:
raise receipt.UnknownAlgorithmException(
self._receipt.receiptId)
algorithm = algorithms.ALGORITHMS[self._algorithmPrefix]
utils.raiseForKey(k, algorithm)
self._key = k
except Exception as e:
self.aes_input.text = ''
displayError(e)
if self._key:
self.decrypt_button.disabled = True
self.updateView()
评论列表
文章目录