Reading ASN1 Content #1341
-
Hello community! My-Schema DEFINITIONS IMPLICIT TAGS ::= I am doing this using the ASN1InputStream class, however I am not able to do it. When reading an object from my stream I always get DLApplicationSpecific and no useful content. Here is my code:
What am I doing wrong and how can I manage to read this input correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
We could help if you provide an example input file. Most likely the file is not a direct BER encoding but has been Hex- or Base64- encoded in some fashion. |
Beta Was this translation helpful? Give feedback.
-
Hi, so my input file would be this: Do I need to encode it in order to read it by this ASN1InputStream? |
Beta Was this translation helpful? Give feedback.
-
The ASN1InputStream is for decoding BER encodings. We don't have parsers for ASN.1 module definitions (i.e. abstract syntax). |
Beta Was this translation helpful? Give feedback.
-
And can I encode this ASN.1 notation to BER using your libraries? |
Beta Was this translation helpful? Give feedback.
-
You'd need to build the actual structure in Java - BC has the support to allow you to describe the generation and encoding of the above in Java. It's not an ASN.1 language parser though, it just supports parsing of the encodings. |
Beta Was this translation helpful? Give feedback.
You'd need to build the actual structure in Java - BC has the support to allow you to describe the generation and encoding of the above in Java. It's not an ASN.1 language parser though, it just supports parsing of the encodings.