refactor and add pin support to program facades

This commit is contained in:
jonesmarvin8
2026-04-24 22:10:04 -04:00
parent 93a1487553
commit 7b4f973f96
25 changed files with 347 additions and 132 deletions
+3 -2
View File
@@ -106,7 +106,7 @@ class KeycardWallet:
public_only = True,
keypath = path
)
# TODO (marvin) clean this up
public_key = public_key.public_key
public_key = VerifyingKey.from_string(public_key[1:], curve=SECP256k1)
public_key = public_key.to_string("compressed")[1:]
@@ -117,11 +117,12 @@ class KeycardWallet:
print(f"Error getting public key: {e}")
return None
def sign_message_for_path(self, message: bytes = b"DefaultMessageTestDefaultMessage", path: str = "m/44'/60'/0'/0/0") -> bytes | None:
try:
if not self.card.is_secure_channel_open or not self.card.is_pin_verified:
return None
signature = self.card.sign_with_path(
digest = message,
path = path,