mirror of
https://github.com/malmeloo/FindMy.py.git
synced 2026-04-27 19:25:43 +02:00
reports: Add LocationReport.key property for decrypted reports
This commit is contained in:
@@ -47,6 +47,16 @@ class LocationReport(HasHashedPublicKey):
|
||||
"""See `HasHashedPublicKey.hashed_adv_key_bytes`."""
|
||||
return self._hashed_adv_key
|
||||
|
||||
@property
|
||||
def key(self) -> KeyPair:
|
||||
"""`KeyPair` using which this report was decrypted."""
|
||||
if not self.is_decrypted:
|
||||
msg = "Full key is unavailable while the report is encrypted."
|
||||
raise RuntimeError(msg)
|
||||
assert self._decrypted_data is not None
|
||||
|
||||
return self._decrypted_data[0]
|
||||
|
||||
@property
|
||||
def payload(self) -> bytes:
|
||||
"""Full (partially encrypted) payload of the report, as retrieved from Apple."""
|
||||
|
||||
Reference in New Issue
Block a user