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.
encode(Module,Type,Value)-> {ok,Bytes} | {error,Reason}
Types:
Module = Type = atom()
Value = term()
Bytes = [Int|binary|Bytes] when integer(Int), Int >= 0, Int =< 255
Reason = term()
Encodes Value of Type defined in the ASN.1 module
Module. Returns a possibly nested list of bytes and or binaries
if successful. To get as fast execution as
possible the
encode function only performs rudimentary tests that the input
Value
is a correct instance of Type. The length of strings is for example
not always checked.
decode(Module,Type,Bytes) -> {ok,Value}|{error,Reason}
Types:
Module = Type = atom()
Value = Reason = term()
Bytes = binary | [Int] when integer(Int), Int >= 0, Int =< 255 | binary
Decodes Type from Module from the list of bytes
Bytes. If the module is compiled with ber_bin or
per_bin option Bytes must be a binary.
Returns {ok,Value} if successful.
validate(Module,Type,Value) -> ok | {error,Reason}
Types:
Module = Type = atom()
Value = term()
Validates that Value conforms to Type
from Module. Not implemented in this version of the
ASN.1 application.