CASN1EncBase Class Reference

class CASN1EncBase : public CBase

Base class for all ASN.1 types that we can encode.

Inherits from

Constructor & Destructor Documentation

CASN1EncBase(const TTagType, const TASN1Class)

IMPORT_C CASN1EncBase ( const TTagType aType,
const TASN1Class aClass
) [protected]

Protected constructor

Parameters

const TTagType aType Tag type of the new object
const TASN1Class aClass Tag class of the new object.

~CASN1EncBase()

IMPORT_C ~CASN1EncBase ( )

Member Functions Documentation

CalculateContentsLengthDER()

void CalculateContentsLengthDER ( ) [private, pure virtual]

Calculates number of octets in DER content encoding. Must set value of the appropriate data member.

CalculateLengthLengthDER()

void CalculateLengthLengthDER ( ) [protected]

Calculates number of octets in DER length encoding. Must set value of the appropriate data member. Made protected because it is needed by CASN1EncEncoding class.

CalculateTagLengthDER()

void CalculateTagLengthDER ( ) [private]

Calculates number of octets in DER tag encoding. Must set value of the appropriate data member.

ConstructL()

IMPORT_C void ConstructL ( ) [protected, virtual]

Must call this version from derived classes in their ConstructL, but only once they're ready to have CalculateContentsLengthDER called on them.

ContentsLengthChanged()

void ContentsLengthChanged ( ) [protected]

Derived classes must call this if the length of their contents changes after construction.

IsConstructed()

TBool IsConstructed ( ) const [private, pure virtual]

LengthDER()

IMPORT_C TUint LengthDER ( ) const

Gives total number of octets in the DER encoding of this object.

SetParent(CASN1EncBase *)

void SetParent ( CASN1EncBase * aParent )

Sets parent for the object

Parameters

CASN1EncBase * aParent Pointer to an ASN.1 object that becomes this object's parent.

SetTag(const TTagType, const TASN1Class)

IMPORT_C void SetTag ( const TTagType aType,
const TASN1Class aClass = EContextSpecific
)

Sets tag type/class of the encoding object

Parameters

const TTagType aType Tag type to set
const TASN1Class aClass = EContextSpecific Tag class to set.

WriteContentsDERL(TDes8 &)

void WriteContentsDERL ( TDes8 & aBuf ) const [private, pure virtual]

Writes DER content encoding into supplied buffer, which is already verified to be big enough. Must be implemented by derived classes.

Parameters

TDes8 & aBuf Buffer to write to.

WriteDERL(TDes8 &, TUint &)

IMPORT_C void WriteDERL ( TDes8 & aBuf,
TUint & aPos
) const

Writes entire DER encoding of this object into the given buffer.

Parameters

TDes8 & aBuf Buffer receiving the encoding.
TUint & aPos Position to start writing at.

WriteHelperL(TDes8 &, TUint &, const TUint, WriteFunc)

void WriteHelperL ( TDes8 & aBuf,
TUint & aPos,
const TUint aLength,
WriteFunc aWriteFunc
) const [private]

Helper function, used for efficiency

Parameters

TDes8 & aBuf Buffer to write to
TUint & aPos Position in the buffer to start writing at (updated on exit)
const TUint aLength Length of data to write
WriteFunc aWriteFunc Points to the function used to perform the actual write operation.

WriteLengthDER(TDes8 &)

void WriteLengthDER ( TDes8 & aBuf ) const [private, virtual]

Writes DER length encoding into supplied buffer, which is already verified to be big enough.

Parameters

TDes8 & aBuf Buffer to write to.

WriteTagDERL(TDes8 &)

void WriteTagDERL ( TDes8 & aBuf ) const [private]

Writes DER tag encoding into supplied buffer, which is already verified to be big enough.

Parameters

TDes8 & aBuf Buffer to write to.

Member Data Documentation

TASN1Class iClass

TASN1Class iClass [private]

TUint iContentsLengthDER

TUint iContentsLengthDER [protected]

TUint iLengthLengthDER

TUint iLengthLengthDER [protected]

CASN1EncBase * iParent

CASN1EncBase * iParent [private]

The object owning this one (if we're held in a sequence, for example).

TUint iTagLengthDER

TUint iTagLengthDER [protected]

TTagType iType

TTagType iType [private]