CPaddingPKCS7 Class Reference

#include <padding.h>

class CPaddingPKCS7 : public CPadding

Inherits from

Detailed Description

This concrete subclass of CPadding implements padding according to the PKCS#7/TLS standard.

Constructor & Destructor Documentation

CPaddingPKCS7 ( TInt )

IMPORT_CCPaddingPKCS7(TIntaBlockBytes)[protected]

Constructor

ParameterDescription
aBlockBytesThe block size in bytes.

Member Function Documentation

MaxPaddedLength ( TInt )

TInt MaxPaddedLength(TIntaInputBytes)const [virtual]

Reimplemented from CPadding::MaxPaddedLength(TInt)const

Gets the size of the aOutput buffer, in a call to PadL(), must be in order to accommodate a block size of BlockSize() and an input size of aInputBytes.

Note:

By default, this function returns the output of BlockSize(). If a derived padding system outputs more than a single block of padding, one must override this function and return the appropriate value.

ParameterDescription
aInputBytesThe amount of data to be padded out in bytes.

Returns: A TInt representing the maximum amount of padded output data (in bytes) for a given block and input size.

MinPaddingLength ( void )

TInt MinPaddingLength(void)const [virtual]

Reimplemented from CPadding::MinPaddingLength(void)const

Gets the smallest number of bytes that PadL() will ever add to aInput in order to get a valid block aligned aOutput.

For example, in SSLv3 padding, if the block size is 8 and aInput is 7 bytes, it will append 1 byte of padding. For SSLv3 padding, this is the smallest amount possible as an 8 byte input will add another block size (8 more bytes) of padded data.

Returns: A TInt containing the smallest number of padding bytes possible.

NewL ( TInt )

IMPORT_C CPaddingPKCS7 *NewL(TIntaBlockBytes)[static]

Creates a new CPaddingPKCS7 object.

ParameterDescription
aBlockBytesThe block size in bytes.

Returns: A pointer to the new CPaddingPKCS7 object.

NewLC ( TInt )

IMPORT_C CPaddingPKCS7 *NewLC(TIntaBlockBytes)[static]

Creates a new CPaddingPKCS7 object and leaves a pointer to it on the cleanup stack.

ParameterDescription
aBlockBytesThe block size in bytes.

Returns: A pointer to the new CPaddingPKCS7 object.

UnPadL ( const TDesC8 &, TDes8 & )

voidUnPadL(const TDesC8 &aInput,
TDes8 &aOutput
)[virtual]

Removes padding from aInput and appends unpadded result to aOutput.

ParameterDescription
aInputData to be unpadded.
aOutputOn return, the unpadded data.