Identity signer update
This commit is contained in:
parent
b7e69e5f91
commit
77da69c37d
@ -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")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user