os/security/crypto/weakcryptospi/source/symmetric/bufferedtransformationshim.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
#ifndef __BUFFEREDTRANSFORMATIONSHIM_H__
sl@0
    20
#define __BUFFEREDTRANSFORMATIONSHIM_H__
sl@0
    21
sl@0
    22
#include <bufferedtransformation.h>
sl@0
    23
sl@0
    24
/**
sl@0
    25
@file
sl@0
    26
@internalComponent
sl@0
    27
@released
sl@0
    28
*/
sl@0
    29
sl@0
    30
namespace CryptoSpi 
sl@0
    31
	{
sl@0
    32
	class CSymmetricCipher;
sl@0
    33
	}
sl@0
    34
sl@0
    35
/**
sl@0
    36
 Shim class that delegates all operations to an Crypto Spi object.
sl@0
    37
 This object is constructed automatically by CBufferedEncryptorShim and should
sl@0
    38
 not be used directly.
sl@0
    39
 */
sl@0
    40
NONSHARABLE_CLASS(CBufferedEncryptorShim) : public CBufferedEncryptor
sl@0
    41
{
sl@0
    42
public:
sl@0
    43
	/**
sl@0
    44
	Creates a new CBufferedEncryptorShim.
sl@0
    45
	N.B. It is the reponsiblity of the CALLER to check that block transform
sl@0
    46
	object contains an SPI delegate and that the delegate supports the specified
sl@0
    47
	padding mode.
sl@0
    48
	*/
sl@0
    49
	static CBufferedEncryptorShim* NewL(CBlockTransformation* aBT, CPadding* aPadding);
sl@0
    50
	
sl@0
    51
	// From CBufferedTransformation
sl@0
    52
	void Process(const TDesC8& aInput, TDes8& aOutput);
sl@0
    53
	TInt MaxOutputLength(TInt aInputLength) const;
sl@0
    54
	void Reset();
sl@0
    55
	TInt BlockSize() const;
sl@0
    56
	TInt KeySize() const;	
sl@0
    57
	void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
sl@0
    58
	TInt MaxFinalOutputLength(TInt aInputLength) const;
sl@0
    59
private:	
sl@0
    60
	CBufferedEncryptorShim(CryptoSpi::CSymmetricCipher* aSymmetricCipherImpl);
sl@0
    61
	void ConstructL(CBlockTransformation* aBT, CPadding* aPadding);
sl@0
    62
	
sl@0
    63
	// owned by block transform - iBT
sl@0
    64
	CryptoSpi::CSymmetricCipher* iSymmetricCipherImpl;
sl@0
    65
};
sl@0
    66
sl@0
    67
/**
sl@0
    68
 Shim class that delegates all operations to an Crypto Spi object.
sl@0
    69
 This object is constructed automatically by CBufferedEncryptorShim and should
sl@0
    70
 not be used directly.
sl@0
    71
 */
sl@0
    72
NONSHARABLE_CLASS(CBufferedDecryptorShim) : public CBufferedDecryptor
sl@0
    73
{
sl@0
    74
public:
sl@0
    75
	/**
sl@0
    76
	Creates a new CBufferedDecryptorShim.
sl@0
    77
	N.B. It is the reponsiblity of the CALLER to check that block transform
sl@0
    78
	object contains an SPI delegate and that the delegate supports the specified
sl@0
    79
	padding mode.
sl@0
    80
	*/
sl@0
    81
	static CBufferedDecryptorShim* NewL(CBlockTransformation* aBT, CPadding* aPadding);
sl@0
    82
	
sl@0
    83
	// From CBufferedTransformation	
sl@0
    84
	void Process(const TDesC8& aInput, TDes8& aOutput);
sl@0
    85
	TInt MaxOutputLength(TInt aInputLength) const;
sl@0
    86
	void Reset();
sl@0
    87
	TInt BlockSize() const;
sl@0
    88
	TInt KeySize() const;	
sl@0
    89
	void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
sl@0
    90
	TInt MaxFinalOutputLength(TInt aInputLength) const;
sl@0
    91
private:	
sl@0
    92
	CBufferedDecryptorShim(CryptoSpi::CSymmetricCipher* aSymmetricCipherImpl);
sl@0
    93
	void ConstructL(CBlockTransformation* aBT, CPadding* aPadding);
sl@0
    94
	
sl@0
    95
	// owned by block transform - iBT
sl@0
    96
	CryptoSpi::CSymmetricCipher* iSymmetricCipherImpl;
sl@0
    97
};
sl@0
    98
sl@0
    99
#endif	//	__BUFFEREDTRANSFORMATIONSHIM_H__