Identity signer update

This commit is contained in:
Mark Qvist 2018-04-26 01:16:16 +02:00
parent b7e69e5f91
commit 77da69c37d
1 changed files with 3 additions and 3 deletions

View File

@ -275,15 +275,15 @@ class Identity:
def sign(self, message):
if self.prv != None:
signer = self.prv.signer(
signature = self.prv.sign(
message,
padding.PSS(
mgf=padding.MGF1(hashes.SHA256()),
salt_length=padding.PSS.MAX_LENGTH
),
hashes.SHA256()
)
signer.update(message)
return signer.finalize()
return signature
else:
raise KeyError("Signing failed because identity does not hold a private key")