os/security/crypto/weakcryptospi/source/padding/paddingshim.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 #ifndef __PADDINGSHIM_H__
    20 #define __PADDINGSHIM_H__
    21 
    22 /**
    23 @file
    24 @internalComponent
    25 @released
    26 */
    27 
    28 #include <padding.h>
    29 
    30 /**
    31 Shim class for CPaddingNone. This should only be created by CPaddingNone.
    32 */
    33 NONSHARABLE_CLASS(CPaddingNoneShim) : public CPaddingNone
    34 	{
    35 public:
    36 	static CPaddingNoneShim* NewL(TInt aBlockBytes);
    37 	static CPaddingNoneShim* NewLC(TInt aBlockBytes);
    38 	
    39 protected:
    40 	// From CBase
    41 	/**
    42 	Used by the CBufferedTransformShim class to determine the type of 
    43 	the padding mode selected. The SPI plug-in is then configured to use
    44 	the selected padding mdoe.
    45 	
    46 	@param aExtensionId The requested interface
    47 	@param a0 Not used. This function does NOT return a real interface.
    48 	@param a1 Not used.
    49 	@return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; 
    50 	otherwise, KErrNotFound is returned.
    51 	*/
    52 	TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);		
    53 private:
    54 	CPaddingNoneShim(TInt aBlockBytes);
    55 	};
    56 
    57 /**
    58 Shim class for CPaddingPKCS1Signature. This should only be created by 
    59 CPaddingPKCS1Signature.
    60 */
    61 NONSHARABLE_CLASS(CPaddingPKCS1SignatureShim) : public CPaddingPKCS1Signature
    62 	{
    63 public:
    64 	static CPaddingPKCS1SignatureShim* NewL(TInt aBlockBytes);
    65 	static CPaddingPKCS1SignatureShim* NewLC(TInt aBlockBytes);
    66 	
    67 protected:
    68 	// From CBase
    69 	/**
    70 	Used by the CBufferedTransformShim class to determine the type of 
    71 	the padding mode selected. The SPI plug-in is then configured to use
    72 	the selected padding mdoe.
    73 	
    74 	@param aExtensionId The requested interface
    75 	@param a0 Not used. This function does NOT return a real interface.
    76 	@param a1 Not used.
    77 	@return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; 
    78 	otherwise, KErrNotFound is returned.
    79 	*/
    80 	TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);		
    81 private:
    82 	CPaddingPKCS1SignatureShim(TInt aBlockBytes);
    83 	};
    84 	
    85 /**
    86 Shim class for CPaddingPKCS1Encryption. This should only be created by 
    87 CPaddingPKCS1Encryption.
    88 */
    89 NONSHARABLE_CLASS(CPaddingPKCS1EncryptionShim) : public CPaddingPKCS1Encryption
    90 	{
    91 public:
    92 	static CPaddingPKCS1EncryptionShim* NewL(TInt aBlockBytes);
    93 	static CPaddingPKCS1EncryptionShim* NewLC(TInt aBlockBytes);
    94 	
    95 protected:
    96 	// From CBase
    97 	/**
    98 	Used by the CBufferedTransformShim class to determine the type of 
    99 	the padding mode selected. The SPI plug-in is then configured to use
   100 	the selected padding mdoe.
   101 	
   102 	@param aExtensionId The requested interface
   103 	@param a0 Not used. This function does NOT return a real interface.
   104 	@param a1 Not used.
   105 	@return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; 
   106 	otherwise, KErrNotFound is returned.
   107 	*/
   108 	TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);		
   109 private:
   110 	CPaddingPKCS1EncryptionShim(TInt aBlockBytes);
   111 	};	
   112 
   113 /**
   114 Shim class for CPaddingSSLv3. This should only be created by 
   115 CPaddingSSLv3.
   116 */
   117 NONSHARABLE_CLASS(CPaddingSSLv3Shim) : public CPaddingSSLv3
   118 	{
   119 public:
   120 	static CPaddingSSLv3Shim* NewL(TInt aBlockBytes);
   121 	static CPaddingSSLv3Shim* NewLC(TInt aBlockBytes);
   122 	
   123 protected:
   124 	// From CBase
   125 	/**
   126 	Used by the CBufferedTransformShim class to determine the type of 
   127 	the padding mode selected. The SPI plug-in is then configured to use
   128 	the selected padding mdoe.
   129 	
   130 	@param aExtensionId The requested interface
   131 	@param a0 Not used. This function does NOT return a real interface.
   132 	@param a1 Not used.
   133 	@return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; 
   134 	otherwise, KErrNotFound is returned.
   135 	*/
   136 	TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);		
   137 private:
   138 	CPaddingSSLv3Shim(TInt aBlockBytes);
   139 	};	
   140 
   141 /**
   142 Shim class for CPaddingPKCS7. This should only be created by 
   143 CPaddingPKCS7.
   144 */
   145 NONSHARABLE_CLASS(CPaddingPKCS7Shim) : public CPaddingPKCS7
   146 	{
   147 public:
   148 	static CPaddingPKCS7Shim* NewL(TInt aBlockBytes);
   149 	static CPaddingPKCS7Shim* NewLC(TInt aBlockBytes);
   150 	
   151 protected:
   152 	// From CBase
   153 	/**
   154 	Used by the CBufferedTransformShim class to determine the type of 
   155 	the padding mode selected. The SPI plug-in is then configured to use
   156 	the selected padding mdoe.
   157 	
   158 	@param aExtensionId The requested interface
   159 	@param a0 Not used. This function does NOT return a real interface.
   160 	@param a1 Not used.
   161 	@return KErrNone if aExtensionId is CryptoSpi::KPaddingModeNoneUid; 
   162 	otherwise, KErrNotFound is returned.
   163 	*/
   164 	TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);		
   165 private:
   166 	CPaddingPKCS7Shim(TInt aBlockBytes);
   167 	};	
   168 
   169 #endif // __PADDINGSHIM_H__