.TH asn1rt 3erl "asn1 1.7" "Ericsson AB" "Erlang Module Definition" .SH NAME asn1rt \- ASN.1 runtime support functions .SH DESCRIPTION .LP This module is the interface module for the ASN\&.1 runtime support functions\&. To encode and decode ASN\&.1 types in runtime the functions in this module should be used\&. .SH EXPORTS .LP .B decode(Module,Type,Bytes) -> {ok,Value}|{error,Reason} .br .RS .LP Types: .RS 3 Module = Type = atom() .br Value = Reason = term() .br Bytes = binary | [Int] when integer(Int), Int >= 0, Int =< 255 | binary .br .RE .RE .RS .LP Decodes \fIType\fR\& from \fIModule\fR\& from the list of bytes or binary \fIBytes\fR\&\&. If the module is compiled with \fIber_bin\fR\& or \fIper_bin\fR\& option \fIBytes\fR\& must be a binary\&. Returns \fI{ok,Value}\fR\& if successful\&. .RE .LP .B encode(Module,Type,Value)-> {ok,BinOrList} | {error,Reason} .br .RS .LP Types: .RS 3 Module = Type = atom() .br Value = term() .br BinOrList = Bytes | binary() .br Bytes = [Int|binary|Bytes] when integer(Int), Int >= 0, Int =< 255 .br Reason = term() .br .RE .RE .RS .LP Encodes \fIValue\fR\& of \fIType\fR\& defined in the ASN\&.1 module \fIModule\fR\&\&. Returns a possibly nested list of bytes and or binaries if successful\&. If \fIModule\fR\& was compiled with the options \fIper_bin\fR\& and \fIoptimize\fR\& the result is a binary\&. To get as fast execution as possible the encode function only performs rudimentary tests that the input \fIValue\fR\& is a correct instance of \fIType\fR\&\&. The length of strings is for example not always checked\&. .RE .LP .B info(Module) -> {ok,Info} | {error,Reason} .br .RS .LP Types: .RS 3 Module = atom() .br Info = list() .br Reason = term() .br .RE .RE .RS .LP \fIinfo/1\fR\& returns the version of the asn1 compiler that was used to compile the module\&. It also returns the compiler options that was used\&. .RE .LP .B load_driver() -> ok | {error,Reason} .br .RS .LP Types: .RS 3 Reason = term() .br .RE .RE .RS .LP This function is obsolete and will be removed in R16A .RE .LP .B unload_driver() -> ok | {error,Reason} .br .RS .LP Types: .RS 3 Reason = term() .br .RE .RE .RS .LP This function is obsolete and will be removed in R16A .RE .LP .B utf8_binary_to_list(UTF8Binary) -> {ok,UnicodeList} | {error,Reason} .br .RS .LP Types: .RS 3 UTF8Binary = binary() .br UnicodeList = [integer()] .br Reason = term() .br .RE .RE .RS .LP \fIutf8_binary_to_list/1\fR\& Transforms a UTF8 encoded binary to a list of integers, where each integer represents one character as its unicode value\&. The function fails if the binary is not a properly encoded UTF8 string\&. .RE .LP .B utf8_list_to_binary(UnicodeList) -> {ok,UTF8Binary} | {error,Reason} .br .RS .LP Types: .RS 3 UnicodeList = [integer()] .br UTF8Binary = binary() .br Reason = term() .br .RE .RE .RS .LP \fIutf8_list_to_binary/1\fR\& Transforms a list of integers, where each integer represents one character as its unicode value, to a UTF8 encoded binary\&. .RE