CryptoSpi::MSymmetricCipherBase Class Reference

class CryptoSpi::MSymmetricCipherBase : public CryptoSpi::MPlugin

The Symmetric Cipher Base definition. Intended to allow plug-ins to implement extensible symmetric cipher functionality, and to work with all known existing symmetric algorithms, e.g. DES, 3DES, ADES, RC2, ARC4 etc

Inherits from

Member Functions Documentation

BlockSize()

TInt BlockSize ( ) const [pure virtual]

Returns the block size in bits. For stream ciphers (e.g. ARC4) the block size is defined to be 8 bits.

KeySize()

TInt KeySize ( ) const [pure virtual]

Returns the size of the current key in bits.

MaxFinalOutputLength(TInt)

TInt MaxFinalOutputLength ( TInt aInputLength ) const [pure virtual]

Returns the maximum length that an output buffer would need to be in order to hold the result of the final processing operation, given the input length aInputLength and the internal state of the cipher.

Parameters

TInt aInputLength The length of input to process

MaxOutputLength(TInt)

TInt MaxOutputLength ( TInt aInputLength ) const [pure virtual]

Returns the maximum length that an output buffer would need to be in order to hold the result of the next process operation, given the input length aInputLength and the internal state of the state of the cipher.

Parameters

TInt aInputLength The length of the input to process

SetCryptoModeL(TUid)

void SetCryptoModeL ( TUid aCryptoMode ) [pure virtual]
Set the crypto mode of this cipher. Reset() is called to reinitialise the cipher.
leave
KErrNotSupported if the crypto 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 aCryptoMode The crypto mode e.g encryption, decryption

SetIvL(const TDesC8 &)

void SetIvL ( const TDesC8 & aIv ) [pure virtual]
Set the initialization vector of this cipher. Reset() is called to reinitialise the cipher.
leave
KErrNotSupported if the current mode of operation does not support this.
leave
KErrArgument If the length of the Iv is not equal to the block size.
leave
... Any of the crypto error codes defined in cryptospi_errs.h or any of the system-wide error codes.

Parameters

const TDesC8 & aIv The initialization vector.

SetKeyL(const CKey &)

void SetKeyL ( const CKey & aKey ) [pure virtual]
Set the key of this cipher. Reset() is called to reinitialise the cipher.
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 & aKey The symmetric key.

SetOperationModeL(TUid)

void SetOperationModeL ( TUid aOperationMode ) [pure virtual]
Set the operation mode of this cipher
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 aOperationMode The operation mode e.g. CBC, ECB etc

SetPaddingModeL(TUid)

void SetPaddingModeL ( TUid aPaddingMode ) [pure virtual]
Set padding Mode of this cipher. Reset() is called to reinitialise the cipher.
leave
KErrNotSupported if the padding 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 aPaddingMode The padding mode e.g. SSLv3, PKCS7