sl@0: /* sl@0: * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __PADDINGSHIM_H__ sl@0: #define __PADDINGSHIM_H__ sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: sl@0: #include sl@0: sl@0: /** sl@0: Shim class for CPaddingNone. This should only be created by CPaddingNone. sl@0: */ sl@0: NONSHARABLE_CLASS(CPaddingNoneShim) : public CPaddingNone sl@0: { sl@0: public: sl@0: static CPaddingNoneShim* NewL(TInt aBlockBytes); sl@0: static CPaddingNoneShim* NewLC(TInt aBlockBytes); sl@0: sl@0: protected: sl@0: // From CBase sl@0: /** sl@0: Used by the CBufferedTransformShim class to determine the type of sl@0: the padding mode selected. The SPI plug-in is then configured to use sl@0: the selected padding mdoe. sl@0: sl@0: @param aExtensionId The requested interface sl@0: @param a0 Not used. This function does NOT return a real interface. sl@0: @param a1 Not used. sl@0: @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; sl@0: otherwise, KErrNotFound is returned. sl@0: */ sl@0: TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); sl@0: private: sl@0: CPaddingNoneShim(TInt aBlockBytes); sl@0: }; sl@0: sl@0: /** sl@0: Shim class for CPaddingPKCS1Signature. This should only be created by sl@0: CPaddingPKCS1Signature. sl@0: */ sl@0: NONSHARABLE_CLASS(CPaddingPKCS1SignatureShim) : public CPaddingPKCS1Signature sl@0: { sl@0: public: sl@0: static CPaddingPKCS1SignatureShim* NewL(TInt aBlockBytes); sl@0: static CPaddingPKCS1SignatureShim* NewLC(TInt aBlockBytes); sl@0: sl@0: protected: sl@0: // From CBase sl@0: /** sl@0: Used by the CBufferedTransformShim class to determine the type of sl@0: the padding mode selected. The SPI plug-in is then configured to use sl@0: the selected padding mdoe. sl@0: sl@0: @param aExtensionId The requested interface sl@0: @param a0 Not used. This function does NOT return a real interface. sl@0: @param a1 Not used. sl@0: @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; sl@0: otherwise, KErrNotFound is returned. sl@0: */ sl@0: TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); sl@0: private: sl@0: CPaddingPKCS1SignatureShim(TInt aBlockBytes); sl@0: }; sl@0: sl@0: /** sl@0: Shim class for CPaddingPKCS1Encryption. This should only be created by sl@0: CPaddingPKCS1Encryption. sl@0: */ sl@0: NONSHARABLE_CLASS(CPaddingPKCS1EncryptionShim) : public CPaddingPKCS1Encryption sl@0: { sl@0: public: sl@0: static CPaddingPKCS1EncryptionShim* NewL(TInt aBlockBytes); sl@0: static CPaddingPKCS1EncryptionShim* NewLC(TInt aBlockBytes); sl@0: sl@0: protected: sl@0: // From CBase sl@0: /** sl@0: Used by the CBufferedTransformShim class to determine the type of sl@0: the padding mode selected. The SPI plug-in is then configured to use sl@0: the selected padding mdoe. sl@0: sl@0: @param aExtensionId The requested interface sl@0: @param a0 Not used. This function does NOT return a real interface. sl@0: @param a1 Not used. sl@0: @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; sl@0: otherwise, KErrNotFound is returned. sl@0: */ sl@0: TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); sl@0: private: sl@0: CPaddingPKCS1EncryptionShim(TInt aBlockBytes); sl@0: }; sl@0: sl@0: /** sl@0: Shim class for CPaddingSSLv3. This should only be created by sl@0: CPaddingSSLv3. sl@0: */ sl@0: NONSHARABLE_CLASS(CPaddingSSLv3Shim) : public CPaddingSSLv3 sl@0: { sl@0: public: sl@0: static CPaddingSSLv3Shim* NewL(TInt aBlockBytes); sl@0: static CPaddingSSLv3Shim* NewLC(TInt aBlockBytes); sl@0: sl@0: protected: sl@0: // From CBase sl@0: /** sl@0: Used by the CBufferedTransformShim class to determine the type of sl@0: the padding mode selected. The SPI plug-in is then configured to use sl@0: the selected padding mdoe. sl@0: sl@0: @param aExtensionId The requested interface sl@0: @param a0 Not used. This function does NOT return a real interface. sl@0: @param a1 Not used. sl@0: @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; sl@0: otherwise, KErrNotFound is returned. sl@0: */ sl@0: TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); sl@0: private: sl@0: CPaddingSSLv3Shim(TInt aBlockBytes); sl@0: }; sl@0: sl@0: /** sl@0: Shim class for CPaddingPKCS7. This should only be created by sl@0: CPaddingPKCS7. sl@0: */ sl@0: NONSHARABLE_CLASS(CPaddingPKCS7Shim) : public CPaddingPKCS7 sl@0: { sl@0: public: sl@0: static CPaddingPKCS7Shim* NewL(TInt aBlockBytes); sl@0: static CPaddingPKCS7Shim* NewLC(TInt aBlockBytes); sl@0: sl@0: protected: sl@0: // From CBase sl@0: /** sl@0: Used by the CBufferedTransformShim class to determine the type of sl@0: the padding mode selected. The SPI plug-in is then configured to use sl@0: the selected padding mdoe. sl@0: sl@0: @param aExtensionId The requested interface sl@0: @param a0 Not used. This function does NOT return a real interface. sl@0: @param a1 Not used. sl@0: @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; sl@0: otherwise, KErrNotFound is returned. sl@0: */ sl@0: TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); sl@0: private: sl@0: CPaddingPKCS7Shim(TInt aBlockBytes); sl@0: }; sl@0: sl@0: #endif // __PADDINGSHIM_H__