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_CCASN1EncBase(const TTagTypeaType,
const TASN1ClassaClass
)[protected]

Protected constructor

Parameters

const TTagType aTypeTag type of the new object
const TASN1Class aClassTag class of the new object.

~CASN1EncBase()

IMPORT_C~CASN1EncBase()

Member Functions Documentation

CalculateContentsLengthDER()

voidCalculateContentsLengthDER()[private, pure virtual]

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

CalculateLengthLengthDER()

voidCalculateLengthLengthDER()[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()

voidCalculateTagLengthDER()[private]

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

ConstructL()

IMPORT_C voidConstructL()[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()

voidContentsLengthChanged()[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 TUintLengthDER()const

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

SetParent(CASN1EncBase *)

voidSetParent(CASN1EncBase *aParent)

Sets parent for the object

Parameters

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

SetTag(const TTagType, const TASN1Class)

IMPORT_C voidSetTag(const TTagTypeaType,
const TASN1ClassaClass = EContextSpecific
)

Sets tag type/class of the encoding object

Parameters

const TTagType aTypeTag type to set
const TASN1Class aClass = EContextSpecificTag class to set.

WriteContentsDERL(TDes8 &)

voidWriteContentsDERL(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 & aBufBuffer to write to.

WriteDERL(TDes8 &, TUint &)

IMPORT_C voidWriteDERL(TDes8 &aBuf,
TUint &aPos
)const

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

Parameters

TDes8 & aBufBuffer receiving the encoding.
TUint & aPosPosition to start writing at.

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

voidWriteHelperL(TDes8 &aBuf,
TUint &aPos,
const TUintaLength,
WriteFuncaWriteFunc
)const [private]

Helper function, used for efficiency

Parameters

TDes8 & aBufBuffer to write to
TUint & aPosPosition in the buffer to start writing at (updated on exit)
const TUint aLengthLength of data to write
WriteFunc aWriteFuncPoints to the function used to perform the actual write operation.

WriteLengthDER(TDes8 &)

voidWriteLengthDER(TDes8 &aBuf)const [private, virtual]

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

Parameters

TDes8 & aBufBuffer to write to.

WriteTagDERL(TDes8 &)

voidWriteTagDERL(TDes8 &aBuf)const [private]

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

Parameters

TDes8 & aBufBuffer 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]