1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/crypto/weakcryptospi/source/padding/paddingshim.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,169 @@
1.4 +/*
1.5 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef __PADDINGSHIM_H__
1.23 +#define __PADDINGSHIM_H__
1.24 +
1.25 +/**
1.26 +@file
1.27 +@internalComponent
1.28 +@released
1.29 +*/
1.30 +
1.31 +#include <padding.h>
1.32 +
1.33 +/**
1.34 +Shim class for CPaddingNone. This should only be created by CPaddingNone.
1.35 +*/
1.36 +NONSHARABLE_CLASS(CPaddingNoneShim) : public CPaddingNone
1.37 + {
1.38 +public:
1.39 + static CPaddingNoneShim* NewL(TInt aBlockBytes);
1.40 + static CPaddingNoneShim* NewLC(TInt aBlockBytes);
1.41 +
1.42 +protected:
1.43 + // From CBase
1.44 + /**
1.45 + Used by the CBufferedTransformShim class to determine the type of
1.46 + the padding mode selected. The SPI plug-in is then configured to use
1.47 + the selected padding mdoe.
1.48 +
1.49 + @param aExtensionId The requested interface
1.50 + @param a0 Not used. This function does NOT return a real interface.
1.51 + @param a1 Not used.
1.52 + @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid;
1.53 + otherwise, KErrNotFound is returned.
1.54 + */
1.55 + TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
1.56 +private:
1.57 + CPaddingNoneShim(TInt aBlockBytes);
1.58 + };
1.59 +
1.60 +/**
1.61 +Shim class for CPaddingPKCS1Signature. This should only be created by
1.62 +CPaddingPKCS1Signature.
1.63 +*/
1.64 +NONSHARABLE_CLASS(CPaddingPKCS1SignatureShim) : public CPaddingPKCS1Signature
1.65 + {
1.66 +public:
1.67 + static CPaddingPKCS1SignatureShim* NewL(TInt aBlockBytes);
1.68 + static CPaddingPKCS1SignatureShim* NewLC(TInt aBlockBytes);
1.69 +
1.70 +protected:
1.71 + // From CBase
1.72 + /**
1.73 + Used by the CBufferedTransformShim class to determine the type of
1.74 + the padding mode selected. The SPI plug-in is then configured to use
1.75 + the selected padding mdoe.
1.76 +
1.77 + @param aExtensionId The requested interface
1.78 + @param a0 Not used. This function does NOT return a real interface.
1.79 + @param a1 Not used.
1.80 + @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid;
1.81 + otherwise, KErrNotFound is returned.
1.82 + */
1.83 + TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
1.84 +private:
1.85 + CPaddingPKCS1SignatureShim(TInt aBlockBytes);
1.86 + };
1.87 +
1.88 +/**
1.89 +Shim class for CPaddingPKCS1Encryption. This should only be created by
1.90 +CPaddingPKCS1Encryption.
1.91 +*/
1.92 +NONSHARABLE_CLASS(CPaddingPKCS1EncryptionShim) : public CPaddingPKCS1Encryption
1.93 + {
1.94 +public:
1.95 + static CPaddingPKCS1EncryptionShim* NewL(TInt aBlockBytes);
1.96 + static CPaddingPKCS1EncryptionShim* NewLC(TInt aBlockBytes);
1.97 +
1.98 +protected:
1.99 + // From CBase
1.100 + /**
1.101 + Used by the CBufferedTransformShim class to determine the type of
1.102 + the padding mode selected. The SPI plug-in is then configured to use
1.103 + the selected padding mdoe.
1.104 +
1.105 + @param aExtensionId The requested interface
1.106 + @param a0 Not used. This function does NOT return a real interface.
1.107 + @param a1 Not used.
1.108 + @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid;
1.109 + otherwise, KErrNotFound is returned.
1.110 + */
1.111 + TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
1.112 +private:
1.113 + CPaddingPKCS1EncryptionShim(TInt aBlockBytes);
1.114 + };
1.115 +
1.116 +/**
1.117 +Shim class for CPaddingSSLv3. This should only be created by
1.118 +CPaddingSSLv3.
1.119 +*/
1.120 +NONSHARABLE_CLASS(CPaddingSSLv3Shim) : public CPaddingSSLv3
1.121 + {
1.122 +public:
1.123 + static CPaddingSSLv3Shim* NewL(TInt aBlockBytes);
1.124 + static CPaddingSSLv3Shim* NewLC(TInt aBlockBytes);
1.125 +
1.126 +protected:
1.127 + // From CBase
1.128 + /**
1.129 + Used by the CBufferedTransformShim class to determine the type of
1.130 + the padding mode selected. The SPI plug-in is then configured to use
1.131 + the selected padding mdoe.
1.132 +
1.133 + @param aExtensionId The requested interface
1.134 + @param a0 Not used. This function does NOT return a real interface.
1.135 + @param a1 Not used.
1.136 + @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid;
1.137 + otherwise, KErrNotFound is returned.
1.138 + */
1.139 + TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
1.140 +private:
1.141 + CPaddingSSLv3Shim(TInt aBlockBytes);
1.142 + };
1.143 +
1.144 +/**
1.145 +Shim class for CPaddingPKCS7. This should only be created by
1.146 +CPaddingPKCS7.
1.147 +*/
1.148 +NONSHARABLE_CLASS(CPaddingPKCS7Shim) : public CPaddingPKCS7
1.149 + {
1.150 +public:
1.151 + static CPaddingPKCS7Shim* NewL(TInt aBlockBytes);
1.152 + static CPaddingPKCS7Shim* NewLC(TInt aBlockBytes);
1.153 +
1.154 +protected:
1.155 + // From CBase
1.156 + /**
1.157 + Used by the CBufferedTransformShim class to determine the type of
1.158 + the padding mode selected. The SPI plug-in is then configured to use
1.159 + the selected padding mdoe.
1.160 +
1.161 + @param aExtensionId The requested interface
1.162 + @param a0 Not used. This function does NOT return a real interface.
1.163 + @param a1 Not used.
1.164 + @return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid;
1.165 + otherwise, KErrNotFound is returned.
1.166 + */
1.167 + TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
1.168 +private:
1.169 + CPaddingPKCS7Shim(TInt aBlockBytes);
1.170 + };
1.171 +
1.172 +#endif // __PADDINGSHIM_H__