CryptoSpi::MHash Class Reference

class CryptoSpi::MHash : public CryptoSpi::MPlugin

The generic CryptoSPI hash definition. Intended to allow plug-ins to implement extensible hash functionality, and to work with all known existing hashing algorithms, e.g. MD2, MD4, MD5, SHA-1, SHA-256, SHA-512, RIPEMD-160, etc.

Inherits from

Member Functions Documentation

CopyL()

MHash *CopyL()[pure virtual]

Creates a new MHash object with the exact same state as the current object.

This function copies all internal state of the message digest. To create a new MHash object without the state of the current object, see ReplicateL().
leave
... Any of the crypto error codes defined in cryptospi_errs.h or any of the system-wide error codes.

Final(const TDesC8 &)

TPtrC8 Final(const TDesC8 &aMessage)[pure virtual]

Produces a final hash value from all the previous updates of data to be hashed.

Parameters

const TDesC8 & aMessageThe data to be included in the hash.

Hash(const TDesC8 &)

TPtrC8 Hash(const TDesC8 &aMessage)[pure virtual]

Adds aMessage to the internal representation of data to be hashed, then returns a TPtrC8 of the finalised hash of all the previously appended messages.

Parameters

const TDesC8 & aMessageThe data to be included in the hash.

ReplicateL()

MHash *ReplicateL()[pure virtual]

Creates a brand new reset MHash object containing no state information from the current object.

To make a copy of a message digest with its internal state intact, see CopyL().
leave
... Any of the crypto error codes defined in cryptospi_errs.h or any of the system-wide error codes.

SetKeyL(const CKey &)

voidSetKeyL(const CKey &aKey)[pure virtual]

Set the key used for HMAC mode operation.
leave
KErrArgument if aKey is not of the expected type.
leave
KErrNotSupported if the key is not of valid length.
leave
... Any of the crypto error codes defined in cryptospi_errs.h or any of the system-wide error codes.

Parameters

const CKey & aKeyThe key for HMAC

SetOperationModeL(TUid)

voidSetOperationModeL(TUidaOperationMode)[pure virtual]

Set the operation mode, ie hash or hmac
leave
KErrNotSupported if the operation mode is not supported.
leave
... Any of the crypto error codes defined in cryptospi_errs.h or any of the system-wide error codes.

Parameters

TUid aOperationModeThe UID to identifiy the operation mode

Update(const TDesC8 &)

voidUpdate(const TDesC8 &aMessage)[pure virtual]

Adds data to the internal representation of messages to be hashed.

Parameters

const TDesC8 & aMessageThe data to be included in the hash.