Skip to content

Conversation

@ar
Copy link
Member

@ar ar commented May 9, 2023

The KeySerialNumber class in its current implementation has several issues that need to be addressed. The properties baseID, deviceID, and transactionCounter are currently stored as simple String variables with limited validation. However, the standard requires that the transaction counter is just the rightmost 21 bits of the 10-byte Key Serial Number (KSN). As part of this refactor, the implementation is updated to comply and enforce this standard.

Instead of keeping three Strings, we now keep two longs (baseId, deviceId) and an int (transactionCounter).

Also added handy methods to get byte representation of those as well as the whole image (getBytes()).

The KeySerialNumber class in its current implementation has several
issues that need to be addressed. The properties baseID, deviceID, and
transactionCounter are currently stored as simple String variables with
limited validation. However, the standard requires that the transaction
counter is just the rightmost 21 bits of the 10-byte Key Serial Number
(KSN). As part of this refactor, the implementation is updated to
comply and enforce this standard.

Instead of keeping three Strings, we now keep two longs (baseId,
deviceId) and an int (transactionCounter).

Also added handy methods to get byte representation of those as well
as the whole image (getBytes()).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants