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

How to export string values? #75

Open
RufusJWB opened this issue Nov 24, 2023 · 15 comments
Open

How to export string values? #75

RufusJWB opened this issue Nov 24, 2023 · 15 comments
Labels
feedback needed More feedback is needed in order to solve.

Comments

@RufusJWB
Copy link

I often have the situation that I have long strings embedded in an ASN.1 data structure:

image

I'd like to be able to extract this string from the UI. Is this possible?

@RufusJWB
Copy link
Author

Any updates on this?

@olibu
Copy link
Contributor

olibu commented Jan 27, 2024

I once added a function to copy the hex value of the selected node. Would it help to provide a context menu to copy the node as hex or as string?

Could look like this:
image

@RufusJWB
Copy link
Author

I would love both options. Probably I'd prefer "Copy String"

@olibu
Copy link
Contributor

olibu commented Jan 28, 2024

You can try my feature branch https://github.com/olibu/asn1js/tree/feature/hexcopy
I do not have an ASN1 with large Strings inside to test it with Strings.

Just click on the hex value you want to extract.

@RufusJWB
Copy link
Author

You can try my feature branch https://github.com/olibu/asn1js/tree/feature/hexcopy

Do you have it deployed somewhere online?

@olibu
Copy link
Contributor

olibu commented Jan 28, 2024 via email

@RufusJWB
Copy link
Author

no. You can download the branch as zip, extract it locally and open the index.html Maybe I find some time to deploy it somewhere, but this will take some time.

I got it working. Thank you!

"Copy as Hex" is working for me but "Copy as String" is not. And I don't find it very intuitive that I need to click on the hex dump. I'd rather like to click on the node in the tree. Would this also be possible?

@olibu
Copy link
Contributor

olibu commented Jan 29, 2024 via email

@RufusJWB
Copy link
Author

There is already a click handler on the node view. Thus I decided to add the function to the hex view. Moving the function to the node view would lead into a lot of rework.

--> In that case, I don't think it is necessary to invest a lot of time. But I would appreciate if also the "Copy as String" would be working

@olibu
Copy link
Contributor

olibu commented Jan 29, 2024

Update is available.
I added a "Copy as Pretty", too.
Do you have an example of a "complex String"?

@RufusJWB
Copy link
Author

Works very well!

Do you have an example of a "compl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u4gUwCwYJYIZIAWUDBAIBoIGTMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTI0MDEyOTA5MjA0M1owKAYJKoZIhvcNAQk0MRswGTALBglghkgBZQMEAgGhCgYIKoZIzj0EAwIwLwYJKoZIhvcNAQkEMSIEIGt3bmSTHrgEVJG9Wvfj+j1fLXA4QQmTnyx7qjjfZNWZMAoGCCqGSM49BAMCBEcwRQIhAKiO8fQj0HvgnsNJtl3amOTEhkOFGx6uzmpEcjhoi5dSAiAjPTtInQTbenicJ6ED12TwuPBtgxZ6RTyGT+M7ns3S4w==

OCTET_STRING @0+215: (215 byte)|{"ietf-voucher-request:voucher":{"assertion":"proximity","serial-number":"0123456789","idevid-issuer":"BBgwFoAUVAuM3M/9L+Si6NDCODkTl+/Bxhs=","domain-cert-revocation-checks":false,"nonce":"+lv3vbqfnY31+NUa8BT4gg=="}}

@olibu
Copy link
Contributor

olibu commented Jan 29, 2024

I fixed an issue with the position of the context menu after scrolling. And the current content is exported to a string if it is no set or sequence.
If you don't have any further point I'm going to make a pull request for this.

@RufusJWB
Copy link
Author

If you don't have any further point I'm going to make a pull request for this.

Please go ahead! I like it.

@lapo-luchini
Copy link
Owner

I merged that into branch github-82, not ready to inclusion in trunk yet, but you can use it right now on the branch via githack.

@lapo-luchini
Copy link
Owner

I forgot to write it here, this this has been online for a couple of weeks.
@RufusJWB is that what you wanted, or not yet?

@lapo-luchini lapo-luchini added the feedback needed More feedback is needed in order to solve. label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback needed More feedback is needed in order to solve.
Projects
None yet
Development

No branches or pull requests

3 participants