First public contribution.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef __BUFFEREDTRANSFORMATIONSHIM_H__
20 #define __BUFFEREDTRANSFORMATIONSHIM_H__
22 #include <bufferedtransformation.h>
32 class CSymmetricCipher;
36 Shim class that delegates all operations to an Crypto Spi object.
37 This object is constructed automatically by CBufferedEncryptorShim and should
40 NONSHARABLE_CLASS(CBufferedEncryptorShim) : public CBufferedEncryptor
44 Creates a new CBufferedEncryptorShim.
45 N.B. It is the reponsiblity of the CALLER to check that block transform
46 object contains an SPI delegate and that the delegate supports the specified
49 static CBufferedEncryptorShim* NewL(CBlockTransformation* aBT, CPadding* aPadding);
51 // From CBufferedTransformation
52 void Process(const TDesC8& aInput, TDes8& aOutput);
53 TInt MaxOutputLength(TInt aInputLength) const;
55 TInt BlockSize() const;
57 void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
58 TInt MaxFinalOutputLength(TInt aInputLength) const;
60 CBufferedEncryptorShim(CryptoSpi::CSymmetricCipher* aSymmetricCipherImpl);
61 void ConstructL(CBlockTransformation* aBT, CPadding* aPadding);
63 // owned by block transform - iBT
64 CryptoSpi::CSymmetricCipher* iSymmetricCipherImpl;
68 Shim class that delegates all operations to an Crypto Spi object.
69 This object is constructed automatically by CBufferedEncryptorShim and should
72 NONSHARABLE_CLASS(CBufferedDecryptorShim) : public CBufferedDecryptor
76 Creates a new CBufferedDecryptorShim.
77 N.B. It is the reponsiblity of the CALLER to check that block transform
78 object contains an SPI delegate and that the delegate supports the specified
81 static CBufferedDecryptorShim* NewL(CBlockTransformation* aBT, CPadding* aPadding);
83 // From CBufferedTransformation
84 void Process(const TDesC8& aInput, TDes8& aOutput);
85 TInt MaxOutputLength(TInt aInputLength) const;
87 TInt BlockSize() const;
89 void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
90 TInt MaxFinalOutputLength(TInt aInputLength) const;
92 CBufferedDecryptorShim(CryptoSpi::CSymmetricCipher* aSymmetricCipherImpl);
93 void ConstructL(CBlockTransformation* aBT, CPadding* aPadding);
95 // owned by block transform - iBT
96 CryptoSpi::CSymmetricCipher* iSymmetricCipherImpl;
99 #endif // __BUFFEREDTRANSFORMATIONSHIM_H__