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(TIntaInputLength)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 aInputLengthThe length of input to process

MaxOutputLength(TInt)

TInt MaxOutputLength(TIntaInputLength)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 aInputLengthThe length of the input to process

SetCryptoModeL(TUid)

voidSetCryptoModeL(TUidaCryptoMode)[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 aCryptoModeThe crypto mode e.g encryption, decryption

SetIvL(const TDesC8 &)

voidSetIvL(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 & aIvThe initialization vector.

SetKeyL(const CKey &)

voidSetKeyL(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 & aKeyThe symmetric key.

SetOperationModeL(TUid)

voidSetOperationModeL(TUidaOperationMode)[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 aOperationModeThe operation mode e.g. CBC, ECB etc

SetPaddingModeL(TUid)

voidSetPaddingModeL(TUidaPaddingMode)[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 aPaddingModeThe padding mode e.g. SSLv3, PKCS7