Updated on 2026-08-14

This commit is contained in:
Tangem 2020-02-25 17:00:28 +03:00
parent d2e1acdee8
commit 8ee3bf8aac
11 changed files with 561 additions and 89 deletions

View file

@ -191,7 +191,7 @@ class CardManager(
*/
fun writeUserData(
cardId: String,
userData: ByteArray,
userData: ByteArray? = null,
userProtectedData: ByteArray? = null,
userCounter: Int? = null,
userProtectedCounter: Int? = null,

View file

@ -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()

View file

@ -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