简体   繁体   中英

How to encode/decode ASN.1 streams with OpenSSL?

I need an API to encode/decode an ASN.1 stream. I've read that OpenSSL supports this in C and I have access to it in my project, though I don't know how to actually use these functions. I effectively need to decode a struct, a SEQUENCE. Can anyone recommend how to do so?

It looks like openssl can be used to generate ASN.1 encodings of data through a cumbersome command line interface. It's not really an API that you could use - you'd be having to create one yourself that, underneath, made a lot of system calls like system("openssl asn1parse -genstr 'UTF8:Hello World'") . That sounds like a lot of work.

You're far better off using a proper ASN.1 toolset, take a look at the tools page on the ITU's website.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM