Updated on 2026-08-14
This commit is contained in:
parent
d2e1acdee8
commit
8ee3bf8aac
11 changed files with 561 additions and 89 deletions
|
|
@ -191,7 +191,7 @@ class CardManager(
|
|||
*/
|
||||
fun writeUserData(
|
||||
cardId: String,
|
||||
userData: ByteArray,
|
||||
userData: ByteArray? = null,
|
||||
userProtectedData: ByteArray? = null,
|
||||
userCounter: Int? = null,
|
||||
userProtectedCounter: Int? = null,
|
||||
|
|
|
|||
|
|
@ -67,10 +67,10 @@ class ReadUserDataCommand: CommandSerializer<ReadUserDataResponse>() {
|
|||
val mapper = TlvMapper(tlvData)
|
||||
ReadUserDataResponse(
|
||||
cardId = mapper.map(TlvTag.CardId),
|
||||
userData = mapper.map(TlvTag.IssuerData),
|
||||
userProtectedData = mapper.map(TlvTag.IssuerDataSignature),
|
||||
userCounter = mapper.map(TlvTag.IssuerDataCounter),
|
||||
userProtectedCounter = mapper.map(TlvTag.IssuerDataCounter)
|
||||
userData = mapper.map(TlvTag.UserData),
|
||||
userProtectedData = mapper.map(TlvTag.UserProtectedData),
|
||||
userCounter = mapper.map(TlvTag.UserCounter),
|
||||
userProtectedCounter = mapper.map(TlvTag.UserProtectedCounter)
|
||||
)
|
||||
} catch (exception: Exception) {
|
||||
throw TaskError.SerializeCommandError()
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ enum class TlvTag(val code: Int) {
|
|||
MaxSignatures, PauseBeforePin2, RemainingSignatures,
|
||||
SignedHashes, Health, TokenDecimal,
|
||||
Offset, Size -> TlvValueType.Uint16
|
||||
UserCounter, IssuerDataCounter -> TlvValueType.Uint32
|
||||
UserCounter, UserProtectedCounter, IssuerDataCounter -> TlvValueType.Uint32
|
||||
IsActivated, TerminalIsLinked -> TlvValueType.BoolValue
|
||||
ManufactureDateTime -> TlvValueType.DateTime
|
||||
ProductMask -> TlvValueType.ProductMask
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue