SenCryptoUtils Class Reference

class SenCryptoUtils

Set of static convenience methods to help in cryptography

Public Member Functions
IMPORT_C HBufC8 * CreateEncodedBinarySecretL (const TDesC8 &, const TDesC8 &)
IMPORT_C HBufC8 * DecodeBase64L (const TDesC8 &)
IMPORT_C HBufC8 * EncodeBase64L (const TDesC8 &)
IMPORT_C HBufC8 * GetPSHA1HashL (const TDesC8 &, const TDesC8 &, const TInt )
IMPORT_C HBufC8 * GetRandomNonceL ()
IMPORT_C HBufC8 * GetTimestampL ()
IMPORT_C HBufC8 * GetTimestampL ( TTime )
IMPORT_C HBufC8 * RandomAndHashMd5LC ()
Private Member Functions
SenCryptoUtils ()

Constructor & Destructor Documentation

SenCryptoUtils()

SenCryptoUtils ( ) [private]

Hide default C++ constructor.

Member Functions Documentation

CreateEncodedBinarySecretL(const TDesC8 &, const TDesC8 &)

IMPORT_C HBufC8 * CreateEncodedBinarySecretL ( const TDesC8 & aSecret,
const TDesC8 & aValueType
) [static]

Parameters

const TDesC8 & aSecret
const TDesC8 & aValueType

DecodeBase64L(const TDesC8 &)

IMPORT_C HBufC8 * DecodeBase64L ( const TDesC8 & aData ) [static]

Parameters

const TDesC8 & aData

EncodeBase64L(const TDesC8 &)

IMPORT_C HBufC8 * EncodeBase64L ( const TDesC8 & aData ) [static]

Parameters

const TDesC8 & aData

GetPSHA1HashL(const TDesC8 &, const TDesC8 &, const TInt)

IMPORT_C HBufC8 * GetPSHA1HashL ( const TDesC8 & aSecret,
const TDesC8 & aSeed,
const TInt aLength
) [static]

Algorithm taken from of TLS specification RFC 2246 - 5.HMAC and the pseudorandom function

P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + HMAC_hash(secret, A(2) + seed) + HMAC_hash(secret, A(3) + seed) + ...

Where + indicates concatenation.

A() is defined as: A(0) = seed A(i) = HMAC_hash(secret, A(i-1))

P_hash can be iterated as many times as is necessary to produce the required quantity of data. For example, if P_SHA-1 was being used to create 64 bytes of data, it would have to be iterated 4 times (through A(4)), creating 80 bytes of output data; the last 16 bytes of the final iteration would then be discarded, leaving 64 bytes of output data.
Since
Series60 3.2.3

Parameters

const TDesC8 & aSecret - secret
const TDesC8 & aSeed - seed
const TInt aLength - length of new secret

GetRandomNonceL()

IMPORT_C HBufC8 * GetRandomNonceL ( ) [static]

GetTimestampL()

IMPORT_C HBufC8 * GetTimestampL ( ) [static]

GetTimestampL(TTime)

IMPORT_C HBufC8 * GetTimestampL ( TTime aTime ) [static]

Parameters

TTime aTime

RandomAndHashMd5LC()

IMPORT_C HBufC8 * RandomAndHashMd5LC ( ) [static]