Update contrib.
2 * Copyright (c) 2003-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.
15 * PBE symmetric factory
25 #ifndef __PBESYMMETRICFACTORY_H__
26 #define __PBESYMMETRICFACTORY_H__
28 #include <symmetric.h>
31 const TUint KAESBlockBytes = 16;
32 const TUint KAESKeyBytes128 = 16;
33 const TUint KAESKeyBytes192 = 24;
34 const TUint KAESKeyBytes256 = 32;
36 const TUint KDESBlockBytes = 8;
37 const TUint KDESKeyBytes = 8;
38 const TUint K3DESKeyBytes = 24;
40 const TUint K2Key3DESKeyBytes = 16;
41 const TUint KRC4KeyBytes128 = 16;
42 const TUint KRC4KeyBytes40 = 5;
44 const TUint KRC2BlockBytes = 8;
45 const TUint KRC2KeyBytes40 = 5;
46 const TUint KRC2KeyBytes128 = 16;
48 const TPBECipher KPBEDefaultStrongCipher = ECipherAES_CBC_128;
49 const TPBECipher KPBEDefaultWeakCipher = ECipherDES_CBC;
50 const TUint KPBEDefaultSaltBytes = 16; //pkcs5 recommends min 64 bits (8 bytes);
52 const TUint KPBEMaxCipherIVBytes = KAESBlockBytes;
53 const TUint KPBEMaxCipherKeyBytes = KAESKeyBytes256;
54 const TUint KPBEMaxSaltBytes = 16; //pkcs5 recommends min 64 bits (8 bytes);
59 static TUint GetKeyBytes(TPBECipher aCipher);
60 static TUint GetBlockBytes(TPBECipher aCipher);
62 static CSymmetricCipher* MakeEncryptorL(TPBECipher aCipher,
63 const TDesC8& aKey, const TDesC8& aIV);
64 static CSymmetricCipher* MakeDecryptorL(TPBECipher aCipher,
65 const TDesC8& aKey, const TDesC8& aIV);
69 PBE& operator=(const PBE&);