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

Tiny Applet Installation Parameters (NDEF TLV) #15

Open
jaredvacanti opened this issue Jul 23, 2021 · 1 comment
Open

Tiny Applet Installation Parameters (NDEF TLV) #15

jaredvacanti opened this issue Jul 23, 2021 · 1 comment

Comments

@jaredvacanti
Copy link

The documentation has an example here of how to install the tiny app variant using param data:

 user@host:~$ java -jar gp.jar \
        -applet D2760000850101 \
        -params 100BD101075402656E54657374 \
        -install build/javacard/javacard-ndef-tiny.cap
 (Install tiny variant with static text "Test")

What is the leading byte of the param data here? Is the param itself a TLV?

Type Length Value ... ... ... ... ... ...
TNF: Type Name Format Type Length Payload Length Type
0x10 0x0B 0xD1 0x01 0x07 0x54 0x02 0x65 0x6E 0x54657374
11 bytes 0b11010001 1 byte 7 bytes T en Test

When I use this python code to generate an NDEF, I only get the payload:

import ndef

record1 = ndef.TextRecord("Test")

encoder = ndef.message_encoder()

encoder.send(None)
encoder.send(record1)
encoder.send(None)

message = [record1]

print(b''.join((ndef.message_encoder(message))).hex())
>>> d101075402656e54657374

It also mentions in the docs for the tiny applet:

You should not prepend the dataset with a length prefix as in the stored form.

So maybe I've missed some other detail. What's the initial byte 0x10 in the tiny applet param? Thanks for any help in advance!

@promovicz
Copy link
Member

promovicz commented Aug 22, 2021

The param that you must provide is a bare NDEF message and will be written to the tag memory as-is.

NDEF messages are TLV, but they do not conform to ASN.1 or any related standards.

I'm not sure about the example though. It might need fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants