Skip to content

Commit fb34c0b

Browse files
authored
Remove dependency on cose for message signing (#477)
* Remove dependency on cose for message signing * format
1 parent f2a9f2f commit fb34c0b

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

pycardano/cip/cip8.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,14 @@ def sign(
9090

9191
msg.key = cose_key # attach the key to the message
9292

93-
if isinstance(signing_key, ExtendedSigningKey):
94-
_message = [
95-
msg.phdr_encoded,
96-
msg.uhdr_encoded,
97-
msg.payload,
98-
signing_key.sign(msg._sig_structure),
99-
]
100-
101-
encoded = dumps(
102-
CBORTag(msg.cbor_tag, _message), default=msg._custom_cbor_encoder
103-
)
104-
105-
else:
106-
encoded = msg.encode()
93+
_message = [
94+
msg.phdr_encoded,
95+
msg.uhdr_encoded,
96+
msg.payload,
97+
signing_key.sign(msg._sig_structure),
98+
]
99+
100+
encoded = dumps(CBORTag(msg.cbor_tag, _message), default=msg._custom_cbor_encoder)
107101

108102
# turn the enocded message into a hex string and remove the first byte
109103
# which is always "d2"

0 commit comments

Comments
 (0)