Obtain a printable signature string #279
-
ecdsaPrivateKey.sign_deterministic(b"message")
I want to get the signatures a string (to save it into txt file) For privatekeys there is ta similar function: ecdsaPrivateKey.to_string().hex()) How could the signature data be transformed into a printable (and therefore txt file - writeable) string format? Thank you in advance for your answer(s)! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you use sigencode function that returns from ecdsa import SigningKey
sk = SigningKey.generate() # uses NIST192p
vk = sk.verifying_key
signature = sk.sign(b"message")
assert vk.verify(signature, b"message")
signature.hex() will return something like
(the contents will vary, but that's the length you can expect for NIST192p) |
Beta Was this translation helpful? Give feedback.
If you use sigencode function that returns
bytes()
, the calling.hex()
on the returned object will give you a string:will return something like
(the contents will vary, but that's the length you can expect for NIST192p)