Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Apple authored and Apple committed Sep 9, 2024
1 parent c8a8aac commit cda0234
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hivemind/utils/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ def sign(self, data: bytes) -> bytes:
signature = self._private_key.sign(data)
return base64.b64encode(signature)

def get_public_key(self) -> RSAPrivateKey:
return RSAPrivateKey(self._private_key.public_key())

def get_public_key(self) -> RSAPublicKey: # Fix: return RSAPublicKey, not RSAPrivateKey
return RSAPublicKey(self._private_key.public_key()) # Return RSAPublicKey

def to_bytes(self) -> bytes:
return self._private_key.private_bytes(
Expand All @@ -72,6 +71,7 @@ def __setstate__(self, state):
self._private_key = ed25519.Ed25519PrivateKey.from_private_bytes(self._private_key)



class RSAPublicKey(PublicKey):
def __init__(self, public_key: ed25519.Ed25519PublicKey):
self._public_key = public_key
Expand Down

0 comments on commit cda0234

Please sign in to comment.