示例#1
0
def keyinput_post(request):
    key = request.POST['key']
    key_objects = PublicKey.make_from_keydata(key)
    if len(key_objects) > 0:
        messages.success(request, "Your key has been imported.  Check your email for an encrypted list of one-time passwords.")
    else:
        messages.error(request, "Key import failed.")
    return HttpResponseRedirect(reverse('djangpgapp.views.index_view'))
示例#2
0
    def authenticate(self, signature_challenge=None, signed_response=None):
        if signature_challenge and signed_response and signature_challenge in signed_response:
            return PublicKey.verify(signed_response).user

        return None