Package spoon :: Package ber :: Module stream
[show private | hide private]
[frames | no frames]

Module spoon.ber.stream

Function Summary
  decode_bool(fd, tag)
list decode_container(fd, tag)
Decode a container into a list of items.
  decode_int(fd, tag)
  decode_list(fd, tag)
  decode_null(fd, tag)
  decode_str(fd, tag)
  decode_unicode(fd, tag)
  encode_bool(fd, item)
  encode_container(fd, tag, items)
Encode a list of items into a container with the given tag and write it to a stream.
  encode_int(fd, item)
  encode_list(fd, items)
  encode_null(fd, item)
  encode_str(fd, item)
  encode_unicode(fd, item)

Variable Summary
Tag BOOL_TYPE = <ASN.1 Tag(UNIVERSAL, 1, size=None, containe...
Tag BYTES_TYPE = <ASN.1 Tag(UNIVERSAL, 4, size=None, contain...
Tag EOF_TYPE = <ASN.1 Tag(UNIVERSAL, 0, size=0, container=Fa...
Tag INT_TYPE = <ASN.1 Tag(UNIVERSAL, 2, size=None, container...
Tag LIST_TYPE = <ASN.1 Tag(UNIVERSAL, 16, size=None, contain...
Tag NULL_TYPE = <ASN.1 Tag(UNIVERSAL, 5, size=None, containe...
int UNIVERSAL_BOOL = 1                                                                     
int UNIVERSAL_BYTES = 4                                                                     
int UNIVERSAL_INT = 2                                                                     
int UNIVERSAL_LIST = 16                                                                    
int UNIVERSAL_NULL = 5                                                                     
int UNIVERSAL_UTF8 = 12                                                                    
Tag UTF8_TYPE = <ASN.1 Tag(UNIVERSAL, 12, size=None, contain...

Function Details

decode_container(fd, tag)

Decode a container into a list of items.
Parameters:
fd - the file object to read from
           (type=file)
tag - the tag from the container
           (type=Tag)
Returns:
a list of decoded objects
           (type=list)

encode_container(fd, tag, items)

Encode a list of items into a container with the given tag and write it to a stream. The list is written using indefinite-length encoding, so no extra copying occurs.
Parameters:
fd - the file object to write into
           (type=file)
tag - the tag to use for this list
           (type=Tag)
items - a list of items to put into the container
           (type=list or iterable)

Variable Details

BOOL_TYPE

Type:
Tag
Value:
<ASN.1 Tag(UNIVERSAL, 1, size=None, container=False)>                  

BYTES_TYPE

Type:
Tag
Value:
<ASN.1 Tag(UNIVERSAL, 4, size=None, container=False)>                  

EOF_TYPE

Type:
Tag
Value:
<ASN.1 Tag(UNIVERSAL, 0, size=0, container=False)>                     

INT_TYPE

Type:
Tag
Value:
<ASN.1 Tag(UNIVERSAL, 2, size=None, container=False)>                  

LIST_TYPE

Type:
Tag
Value:
<ASN.1 Tag(UNIVERSAL, 16, size=None, container=True)>                  

NULL_TYPE

Type:
Tag
Value:
<ASN.1 Tag(UNIVERSAL, 5, size=None, container=False)>                  

UNIVERSAL_BOOL

Type:
int
Value:
1                                                                     

UNIVERSAL_BYTES

Type:
int
Value:
4                                                                     

UNIVERSAL_INT

Type:
int
Value:
2                                                                     

UNIVERSAL_LIST

Type:
int
Value:
16                                                                    

UNIVERSAL_NULL

Type:
int
Value:
5                                                                     

UNIVERSAL_UTF8

Type:
int
Value:
12                                                                    

UTF8_TYPE

Type:
Tag
Value:
<ASN.1 Tag(UNIVERSAL, 12, size=None, container=False)>                 

Generated by Epydoc 2.1 on Sun Nov 26 15:33:58 2006 http://epydoc.sf.net