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

Support for multibyte tags in TLVWriter #61

Open
dmercer-google opened this issue Jul 26, 2023 · 1 comment
Open

Support for multibyte tags in TLVWriter #61

dmercer-google opened this issue Jul 26, 2023 · 1 comment

Comments

@dmercer-google
Copy link
Collaborator

dmercer-google commented Jul 26, 2023

TLVWriter doesn't offer good support for multibyte tags. It should also have a writeTag(byte[] tag) method.

I also noticed that writeTag(short tag) doesn't set a multibyte indicator byte nor does it set the continuation bit on the high byte.

Regarding how the multibyte indicator is added and continuation bit(s) are set or not set, this should be clearly documented in the API comments.

Regardless of your choice of supporting writeTag(byte[] tag) you should clearly document how the various writeTag methods work with respect to setting the multibyte indicator byte and if the user is expected to set the continuation bit.

@makinako
Copy link
Owner

makinako commented Aug 1, 2023

As described in issue #60, the expectation is that the values are already constructed with the required class/multibyte indicators. it makes for a terrible general purpose TLV encoder but does the job for PIV, which has very simple requirements for its responses.
The point is taken here that it is worth at least documenting the implementation decisions and constraints. I'll do that.

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

No branches or pull requests

2 participants