Identity signer update

This commit is contained in:
Mark Qvist 2018-04-26 01:16:16 +02:00
parent b7e69e5f91
commit 77da69c37d

View File

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