SenCryptoUtils Class Reference

#include <mw/sencryptoutils.h>

class SenCryptoUtils
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()

Detailed Description

Set of static convenience methods to help in cryptography

Member Function Documentation

CreateEncodedBinarySecretL ( const TDesC8 &, const TDesC8 & )

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

DecodeBase64L ( const TDesC8 & )

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

EncodeBase64L ( const TDesC8 & )

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

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

IMPORT_C HBufC8 *GetPSHA1HashL(const TDesC8 &aSecret,
const TDesC8 &aSeed,
const TIntaLength
)[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 4.0
ParameterDescription
aSecret- secret
aSeed- seed
aLength- length of new secret

GetRandomNonceL ( )

IMPORT_C HBufC8 *GetRandomNonceL()[static]

GetTimestampL ( )

IMPORT_C HBufC8 *GetTimestampL()[static]

GetTimestampL ( TTime )

IMPORT_C HBufC8 *GetTimestampL(TTimeaTime)[static]

RandomAndHashMd5LC ( )

IMPORT_C HBufC8 *RandomAndHashMd5LC()[static]