forked from martinpaljak/GlobalPlatformPro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
martinpaljak#153: Add initial functionality of including DM token cal…
…culation for INSTALL [for load]. Minor refactoring for more clarity.
- Loading branch information
1 parent
f94d7f5
commit f99b873
Showing
4 changed files
with
122 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The same structure is constructed in loadCapFile, everything omitting INS of the APDU to the place where the token should be inserted.
Same applies to other operations that need to be authorized with a token. Thus is makes sense to have something around the lines:
DelegatedManagementHandler dm = new DelegatedManagementHandler(Key dmKey)
CommandAPDU apdu = new CommandAPDU(CLA_GP, INS_INSTALL, P1, P2 ... )
CommandAPDU dm_applied_apdu = dm.apply(CommandAPDU apdu)
If DM has not been configured with a key, would return an APDU where 0x00 is used for the token, otherwise it would sign the APDU with the valid token.