CASN1EncBitString Class Reference

class CASN1EncBitString : public CASN1EncPrimitive

Class for encoding bit strings (keys, for example).

Inherits from

Constructor & Destructor Documentation

CASN1EncBitString()

CASN1EncBitString()[private]

~CASN1EncBitString()

IMPORT_C~CASN1EncBitString()

Member Functions Documentation

CalculateContentsLengthDER()

voidCalculateContentsLengthDER()[private, virtual]

Calculates length of DER-encoded bit string contents. For non empty bit strings this differs from octet string in the extra leading byte containing the number of unused bits in the last octet.

ConstructL(const TDesC8 &)

voidConstructL(const TDesC8 &aBitStr)[private]

Parameters

const TDesC8 & aBitStr

ConstructL(const TDesC8 &, TUint)

voidConstructL(const TDesC8 &aBitStr,
TUintaLengthBits
)[private]

Parameters

const TDesC8 & aBitStr
TUint aLengthBits

ConstructL(const CASN1EncBase &)

voidConstructL(const CASN1EncBase &aAsnObj)[private]
Constructs bit string from ASN.1 encoding object.
Note:

First produces raw DER encoding from the object, then creates a bit string using other construct function.

Parameters

const CASN1EncBase & aAsnObjASN.1 encoding object to wrap in bit string.

NewL(const TDesC8 &)

IMPORT_C CASN1EncBitString *NewL(const TDesC8 &aBitStr)[static]

Constructs a new DER bit string encoder from a bit string that does not have unused bits at the end, i.e. is octet-aligned. The passed string must be in big-endian format.

Parameters

const TDesC8 & aBitStrOctet-aligned bit string.

NewL(const TDesC8 &, TUint)

IMPORT_C CASN1EncBitString *NewL(const TDesC8 &aBitStr,
TUintaLengthBits
)[static]

Constructs a new DER bit string encoder from a bit string that is not octet-aligned, which means it has unused bits in its last octet. The passed string must be in big-endian format.

Parameters

const TDesC8 & aBitStrBit string.
TUint aLengthBitsLength in bits of the passed bit string. The function will panic if aLengthBits is greater than the actual bit length of aBitString, or the difference is more that 7 bits.

NewL(const CASN1EncBase &)

IMPORT_C CASN1EncBitString *NewL(const CASN1EncBase &aAsnObj)[static]

Wraps the passed encoding object into a bit string.

Parameters

const CASN1EncBase & aAsnObjEncoding object to wrap.

NewLC(const TDesC8 &)

IMPORT_C CASN1EncBitString *NewLC(const TDesC8 &aBitStr)[static]

Constructs a new DER bit string encoder from a bit string that does not have unused bits at the end, i.e. is octet-aligned. The passed string must be in big-endian format.

Parameters

const TDesC8 & aBitStrOctet-aligned bit string.

NewLC(const TDesC8 &, TUint)

IMPORT_C CASN1EncBitString *NewLC(const TDesC8 &aBitStr,
TUintaLengthBits
)[static]

Constructs a new DER bit string encoder from a bit string that is not octet-aligned, which means it has unused bits in its last octet. The passed string must be in big-endian format.

Parameters

const TDesC8 & aBitStrBit string.
TUint aLengthBitsLength in bits of the passed bit string. The function will panic if aLengthBits is greater than the actual bit length of aBitString, or the difference is more that 7 bits.

NewLC(const CASN1EncBase &)

IMPORT_C CASN1EncBitString *NewLC(const CASN1EncBase &aAsnObj)[static]

Wraps the passed encoding object into a bit string.

Parameters

const CASN1EncBase & aAsnObjEncoding object to wrap.

WriteContentsDERL(TDes8 &)

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

Writes DER-encoded bit string contents to aBuf. Prepends the actual bit string octets with extra octet containing number of unused bits in the last octet. Before writing, converts contents of the bit string to big-endian form.

Parameters

TDes8 & aBufBuffer to write to; must be long enough; see CalculateContentsLengthDER method.

Member Data Documentation

HBufC8 * iContents

HBufC8 *iContents[private]

TUint8 iPadding

TUint8 iPadding[private]