Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class testClass(TemplateView):
- template_name = 'cryptator/decrypt_test.html'
- def get_context_data(self, **kwargs):
- context = super(testClass, self).get_context_data(**kwargs)
- public_read = Public_keys.objects.all().filter(owner="Merkantil")
- pwdencsign = Attachment.objects.values_list('file', flat=True).filter(file__endswith=".pwdencsign")
- pwdenc = Attachment.objects.values_list('file', flat=True).filter(file__endswith=".pwdenc")
- enc = Attachment.objects.values_list('file', flat=True).filter(file__endswith=".enc")
- pubtest = public_read[0]
- pwdenc_r = pwdenc[0]
- pwdencsign_r = pwdencsign[0]
- file_pwdenc = "/opt/cryptator/media/%s" % (pwdenc_r)
- file_pwdencsign = "/opt/cryptator/media/%s" % (pwdencsign_r)
- with open(file_pwdenc) as f:
- string_pwdenc = f.read()
- with open(file_pwdencsign) as fs:
- string_pwdencsign = fs.read()
- verify = crypto.verify(pubtest, string_pwdencsign, string_pwdenc, 'sha256')
- context['verify'] = verify
- return context
Add Comment
Please, Sign In to add comment