Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeySerialNumber overhaul #536

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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.

1 participant