|
1 | 1 | from typing import Optional, Union
|
2 | 2 |
|
3 | 3 | from cbor2 import CBORTag, dumps
|
4 |
| - |
5 | 4 | from cose.algorithms import EdDSA
|
6 | 5 | from cose.headers import KID, Algorithm
|
7 | 6 | from cose.keys import CoseKey
|
|
14 | 13 | from pycardano.address import Address
|
15 | 14 | from pycardano.crypto import BIP32ED25519PublicKey
|
16 | 15 | from pycardano.key import (
|
17 |
| - PaymentVerificationKey, |
18 |
| - SigningKey, |
19 | 16 | ExtendedSigningKey,
|
20 | 17 | ExtendedVerificationKey,
|
| 18 | + PaymentVerificationKey, |
| 19 | + SigningKey, |
21 | 20 | StakeExtendedSigningKey,
|
22 | 21 | StakeSigningKey,
|
23 | 22 | StakeVerificationKey,
|
@@ -129,7 +128,6 @@ def sign(
|
129 | 128 | def verify(
|
130 | 129 | signed_message: Union[str, dict],
|
131 | 130 | attach_cose_key: Optional[bool] = None,
|
132 |
| - extended=False, |
133 | 131 | ) -> dict:
|
134 | 132 | """Verify the signature of a COSESign1 message and decode its contents following CIP-0008.
|
135 | 133 | Supports messages signed by browser wallets or `Message.sign()`.
|
@@ -196,7 +194,7 @@ def verify(
|
196 | 194 | # attach the key to the decoded message
|
197 | 195 | decoded_message.key = cose_key
|
198 | 196 |
|
199 |
| - if extended: |
| 197 | + if len(verification_key) > 32: |
200 | 198 | vk = BIP32ED25519PublicKey(
|
201 | 199 | public_key=verification_key[:32], chain_code=verification_key[32:]
|
202 | 200 | )
|
|
0 commit comments