Erlang and asn.1

Per Bergqvist <>
Wed Jan 2 12:13:53 CET 2002


Hi Segio,                                                             
                                                                      
Put your ASN.1 definition in a .asn file and run it through the ASN   
compiler.                                                             
i.e. erlc MyDefs.asn                                                  
                                                                      
This will generate encoder and decoder logic in Erlang.               
                                                                      
To decode a BER encoded record of MyType:                             
                                                                      
asn1rt:decode('MyDefs','MyType',BerEncRecord).                        
                                                                      
Please note that the ASN compiler does not (at least did not prior to 
R8) support all ASN.1 constructs.                                     
Please let me know if you run into any problems.                      
                                                                      
/Per                                                                  
                                                                      
> Hi,                                                                 
>                                                                     
> I am just about to discover erlang and ASN.1. I have a special need 
and                                                                   
> am wondering if erlang is able to solve my problem: we receive BER  
> encoded (according to a well defined ASN.1 grammar) files (called   
> "enc_file") and I will need to decode them.                         
>                                                                     
> Where do I start? So far I have managed to compile the ASN.1 file   
and                                                                   
> have a module that provides encode and decode routines.             
> I have read the documentation but this did not bring me any further.
>                                                                     
> How do I decode file "enc_file", do I have to define my own decoding
> logic or do there exist out-of-the box tools?                       
>                                                                     
> Any hints will be greatly appreciated.                              
>                                                                     
> I nearly forgot to wish you a Happy New Year!                       
>                                                                     
> Sergio da Silva                                                     
>                                                                     
=========================================================             
Per Bergqvist                                                         
Synapse Systems AB                                                    
Phone: +46 709 686 685                                                
Email:                                                    



More information about the erlang-questions mailing list