-
Notifications
You must be signed in to change notification settings - Fork 29
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
Write raw der #190
Comments
I think the right way to do this would be a public constructor on |
As you wish =) |
Are you interested in contributing a PR for this? |
No, I found a workaround. |
I am. Is it still considered? |
Yes, we’d be happy to review a public Tlv constructor. |
I've looked into the implementation, and seems like making the constructor wouldn't make much sense besides allowing the type to be used in const contexts and having a shortcut since one could just use the |
If you want to simply write raw data in a fashion like this, you can create
your own type implementing the Asn1Writable trait.
…On Sat, May 6, 2023 at 2:35 PM turbocool3r ***@***.***> wrote:
Yes, we’d be happy to review a public Tlv constructor.
I've looked into the implementation, and seems like making the constructor
wouldn't make much sense besides allowing the type to be used in const
contexts and having a shortcut since one could just use the parse
function. This wouldn't be very convenient however in cases when you have a
piece of data that doesn't come in one slice. Like you want to embed a
large file in a DER wrapper and you read it in parts or you have some kind
of an internal format encoded into an octet string. You'll have to first
encode it into a vector and then build a Tlv. A much simpler and
effective design would be to allow writing raw data. This would require
something similar to encoded_len() from the der crate though to encode
the length beforehand.
—
Reply to this email directly, view it on GitHub
<#190 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBDYNGJFKGWJJZZVKLTXE2RW7ANCNFSM5ACU4UGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
Hey! Thank you so much for your crate.
I found a requirement to write a raw DER slice into the writer. Something like https://docs.rs/yasna/0.4.0/yasna/struct.DERWriter.html#method.write_der. Would you please implement it?
The text was updated successfully, but these errors were encountered: