Add private key export support

- Add PRIVATE_KEY and DISABLED event types
- Add packet parsing for private key export responses
- Add export_private_key() method to DeviceCommands
- Add comprehensive unit tests
- Add BLE private key export example
- Update documentation with security notes
This commit is contained in:
agessaman
2025-10-12 18:23:32 -07:00
parent c697c960a6
commit e0f71482c6
6 changed files with 305 additions and 0 deletions

View File

@@ -202,3 +202,7 @@ class DeviceCommands(CommandHandlerBase):
data = b"\x20" + channel_idx.to_bytes(1, "little") + name_bytes + channel_secret
return await self.send(data, [EventType.OK, EventType.ERROR])
async def export_private_key(self) -> Event:
logger.debug("Requesting private key export")
return await self.send(b"\x17", [EventType.PRIVATE_KEY, EventType.DISABLED, EventType.ERROR])