os/security/crypto/weakcryptospi/test/tcryptospi/src/te_cryptospiconversion.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2007-2010 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
/**
sl@0
    20
 @file
sl@0
    21
 @internalTechnology
sl@0
    22
*/
sl@0
    23
sl@0
    24
#include "te_cryptospiconversion.h"
sl@0
    25
#include "te_cryptospidefs.h"
sl@0
    26
#include <cryptospi/cryptohashapi.h>
sl@0
    27
#include <cryptospi/cryptorandomapi.h>
sl@0
    28
#include <cryptospi/cryptosymmetriccipherapi.h>
sl@0
    29
#include <cryptospi/cryptoasymmetriccipherapi.h>
sl@0
    30
#include <cryptospi/cryptosignatureapi.h>
sl@0
    31
#include <cryptospi/cryptokeypairgeneratorapi.h>
sl@0
    32
#include <cryptospi/cryptokeyagreementapi.h>
sl@0
    33
#include <cryptospi/ruleselector.h>
sl@0
    34
sl@0
    35
using namespace CryptoSpi;
sl@0
    36
sl@0
    37
//Returns the Uid representation for the stored string value
sl@0
    38
TVariantPtrC::operator TUid()
sl@0
    39
	{
sl@0
    40
	if (*this==_L("KAlgorithmHashMd2"))	return KMd2Uid;	
sl@0
    41
	else if (*this==_L("KAlgorithmHashMd5")) return KMd5Uid;
sl@0
    42
	else if (*this==_L("KAlgorithmHashSha1")) return KSha1Uid;
sl@0
    43
	else if (*this==_L("KAlgorithmHashMd4")) return KMd4Uid;
sl@0
    44
	else if (*this==_L("KAlgorithmHashSha224")) return KSha224Uid;
sl@0
    45
	else if (*this==_L("KAlgorithmHashSha256")) return KSha256Uid;
sl@0
    46
	else if (*this==_L("KAlgorithmHashSha384")) return KSha384Uid;
sl@0
    47
	else if (*this==_L("KAlgorithmHashSha512")) return KSha512Uid;
sl@0
    48
	else if (*this==_L("KAlgorithmRandom")) return KRandomUid;	
sl@0
    49
	else if (*this==_L("KAlgorithmCipherDes")) return KDesUid;	
sl@0
    50
	else if (*this==_L("KAlgorithmCipher3Des")) return K3DesUid;
sl@0
    51
	else if (*this==_L("KAlgorithmCipherRc2")) return KRc2Uid;
sl@0
    52
	else if (*this==_L("KAlgorithmCipherArc4")) return KArc4Uid;
sl@0
    53
	else if (*this==_L("KAlgorithmCipherAes")) return KAesUid;
sl@0
    54
	else if (*this==_L("KAlgorithmCipherMisty1")) return KMisty1Uid;
sl@0
    55
	else if (*this==_L("KAlgorithmCipherMisty2")) return KMisty2Uid;
sl@0
    56
	else if (*this==_L("KAlgorithmCipherKasumi")) return KKasumiUid;
sl@0
    57
	else if (*this==_L("KAlgorithmCipherRsa")) return KRsaCipherUid;
sl@0
    58
	else if (*this==_L("KAlgorithmSignerRsa")) return KRsaSignerUid;
sl@0
    59
	else if (*this==_L("KAlgorithmSignerDsa")) return KDsaSignerUid; 
sl@0
    60
	else if (*this==_L("KAlgorithmVerifierRsa")) return KRsaVerifierUid;
sl@0
    61
	else if (*this==_L("KAlgorithmVerifierDsa")) return KDsaVerifierUid;
sl@0
    62
	else if (*this==_L("KAlgorithmKeyAgreementDH")) return KDHAgreementUid;
sl@0
    63
	else if (*this==_L("KAlgorithmRSAKeyPairGenerator")) return KRSAKeyPairGeneratorUid;
sl@0
    64
	else if (*this==_L("KAlgorithmDSAKeyPairGenerator")) return KDSAKeyPairGeneratorUid;
sl@0
    65
	else if (*this==_L("KAlgorithmDHKeyPairGenerator")) return KDHKeyPairGeneratorUid;
sl@0
    66
sl@0
    67
	else if (*this==_L("KHashInterface")) return KHashInterfaceUid;
sl@0
    68
	else if (*this==_L("KRandomInterface")) return KRandomInterfaceUid;
sl@0
    69
	else if (*this==_L("KSymmetricCipherInterface")) return KSymmetricCipherInterfaceUid;
sl@0
    70
	else if (*this==_L("KAsymmetricCipherInterface")) return KAsymmetricCipherInterfaceUid;
sl@0
    71
	else if (*this==_L("KSignerInterface")) return KSignerInterfaceUid;
sl@0
    72
	else if (*this==_L("KVerifierInterface")) return KVerifierInterfaceUid;
sl@0
    73
	else if (*this==_L("KKeyAgreementInterface")) return KKeyAgreementInterfaceUid;
sl@0
    74
	else if (*this==_L("KKeyGeneratorInterface")) return KKeyGeneratorInterfaceUid;
sl@0
    75
	else if (*this==_L("KKeypairGeneratorInterface")) return KKeypairGeneratorInterfaceUid;
sl@0
    76
	else if (*this==_L("KAsyncHashInterface")) return KAsyncHashInterfaceUid;
sl@0
    77
	else if (*this==_L("KAsyncRandomInterface")) return KAsyncRandomInterfaceUid;
sl@0
    78
	else if (*this==_L("KAsyncSymmetricCipherInterface")) return KAsyncSymmetricCipherInterfaceUid;
sl@0
    79
	else if (*this==_L("KAsyncAsymmetricCipherInterface")) return KAsyncAsymmetricCipherInterfaceUid;
sl@0
    80
	else if (*this==_L("KAsyncSignerInterface")) return KAsyncSignerInterfaceUid;
sl@0
    81
	else if (*this==_L("KAsyncVerifierInterface")) return KAsyncVerifierInterfaceUid;
sl@0
    82
	else if (*this==_L("KAsyncKeyAgreementInterface")) return KAsyncKeyAgreementInterfaceUid;
sl@0
    83
	else if (*this==_L("KAsyncKeyGeneratorInterface")) return KAsyncKeyGeneratorInterfaceUid;
sl@0
    84
	else if (*this==_L("KAsyncKeypairGeneratorInterface")) return KAsyncKeypairGeneratorInterfaceUid;
sl@0
    85
	
sl@0
    86
	else if (*this==_L("KCryptoModeEncrypt")) return KCryptoModeEncryptUid;
sl@0
    87
	else if (*this==_L("KCryptoModeDecrypt")) return KCryptoModeDecryptUid;
sl@0
    88
	
sl@0
    89
	else if (*this==_L("KOperationModeNone")) return KOperationModeNoneUid;	
sl@0
    90
	else if (*this==_L("KOperationModeECB")) return KOperationModeECBUid;
sl@0
    91
	else if (*this==_L("KOperationModeCBC")) return KOperationModeCBCUid;
sl@0
    92
	else if (*this==_L("KOperationModeOFB")) return KOperationModeOFBUid;
sl@0
    93
	else if (*this==_L("KOperationModeCFB")) return KOperationModeCFBUid;
sl@0
    94
	else if (*this==_L("KOperationModeCTR")) return KOperationModeCTRUid;
sl@0
    95
	else if (*this==_L("KHashMode")) return KHashModeUid;
sl@0
    96
	else if (*this==_L("KHmacMode")) return KHmacModeUid;
sl@0
    97
	
sl@0
    98
	else if (*this==_L("KPaddingInterface")) return KPaddingInterfaceUid;	
sl@0
    99
	else if (*this==_L("KPaddingModeNone")) return KPaddingModeNoneUid;
sl@0
   100
	else if (*this==_L("KPaddingModeSSLv3")) return KPaddingModeSSLv3Uid;
sl@0
   101
	else if (*this==_L("KPaddingModePKCS7")) return KPaddingModePKCS7Uid;
sl@0
   102
	else if (*this==_L("KPaddingModePkcs1_v1_5_Encryption")) return KPaddingModePkcs1_v1_5_EncryptionUid;
sl@0
   103
	else if (*this==_L("KPaddingModePkcs1_v1_5_Signature")) return KPaddingModePkcs1_v1_5_SignatureUid;
sl@0
   104
	
sl@0
   105
	else if (*this==_L("KSymmetricKey")) return	KSymmetricKeyUid;
sl@0
   106
	else if (*this==_L("KSymmetricKeyParameter")) return KSymmetricKeyParameterUid;
sl@0
   107
	else if (*this==_L("KRsaKeyParameterN")) return KRsaKeyParameterNUid;
sl@0
   108
	else if (*this==_L("KHmacKey")) return	KHmacKeyUid;
sl@0
   109
	else if (*this==_L("KHmacKeyParameter")) return KHmacKeyParameterUid;
sl@0
   110
			
sl@0
   111
	else if (*this==_L("KRsaSigner")) return KRsaSignerUid;
sl@0
   112
	else if (*this==_L("KDsaSigner")) return KDsaSignerUid;
sl@0
   113
	
sl@0
   114
	else if (*this==_L("KNone")) return KNoneUid;
sl@0
   115
	else if (*this==_L("KInterfaceType")) return KInterfaceTypeUid;
sl@0
   116
	else if (*this==_L("KAlgorithmType")) return KAlgorithmTypeUid;
sl@0
   117
	else if (*this==_L("KImplementationType")) return KImplementationTypeUid;
sl@0
   118
	else if (*this==_L("KCreatorNameType")) return KCreatorNameTypeUid;
sl@0
   119
	else if (*this==_L("KIsFIPSApprovedType")) return KIsFIPSApprovedTypeUid;
sl@0
   120
	else if (*this==_L("KIsHardwareSupportedType")) return KIsHardwareSupportedTypeUid;
sl@0
   121
	else if (*this==_L("KMaxConcurrencySupportedType")) return KMaxConcurrencySupportedTypeUid;
sl@0
   122
	else if (*this==_L("KLatencyType")) return KLatencyTypeUid;
sl@0
   123
	else if (*this==_L("KThroughputType")) return KThroughputTypeUid;
sl@0
   124
	else if (*this==_L("KBlockSizeType")) return KBlockSizeTypeUid;
sl@0
   125
	else if (*this==_L("KOutputSizeType")) return KOutputSizeTypeUid;
sl@0
   126
	else if (*this==_L("KSupportedOperationModesType")) return KSupportedOperationModesTypeUid;
sl@0
   127
	else if (*this==_L("KBlockingModeType")) return KBlockingModeTypeUid;
sl@0
   128
	else if (*this==_L("KMaximumKeyLengthType")) return KMaximumKeyLengthTypeUid;
sl@0
   129
	else if (*this==_L("KSupportedPaddingModesType")) return KSupportedPaddingModesTypeUid;
sl@0
   130
	else if (*this==_L("KKeySupportModeType")) return KKeySupportModeTypeUid;
sl@0
   131
	else if (*this==_L("KConcurrencyType")) return KConcurrencyTypeUid;
sl@0
   132
	else if (*this==_L("KExclusiveUseType")) return KExclusiveUseTypeUid;
sl@0
   133
	
sl@0
   134
	else if (*this==_L("KExtendCharType1")) return KExtendCharType1Uid;
sl@0
   135
	else if (*this==_L("KExtendCharType2")) return KExtendCharType2Uid;
sl@0
   136
	else if (*this==_L("KExtendCharType3")) return KExtendCharType3Uid;
sl@0
   137
#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
sl@0
   138
	else if (*this==_L("KAlgorithmCipherAesXcbcMac96")) return KAesXcbcMac96Uid;
sl@0
   139
	else if (*this==_L("KAlgorithmCipherAesXcbcPrf128")) return KAesXcbcPrf128Uid;
sl@0
   140
	else if (*this==_L("KMacInterface")) return KMacInterfaceUid;
sl@0
   141
	else if (*this==_L("KMacModeType")) return KMacModeTypeUid;
sl@0
   142
#endif
sl@0
   143
#if (defined(SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT) && defined(SYMBIAN_ENABLE_SDP_ECC))
sl@0
   144
    else if (*this==_L("KAlgorithmCipherEcc")) return KEccCipherUid;
sl@0
   145
    else if (*this==_L("KAlgorithmSignerEcc")) return KEccSignerUid;
sl@0
   146
#endif
sl@0
   147
	else
sl@0
   148
		{
sl@0
   149
		User::Panic(*this,KErrNotFound);
sl@0
   150
		return TUid::Null();	
sl@0
   151
		}		
sl@0
   152
	}	
sl@0
   153
sl@0
   154
//Returns the TInt representation for the stored string value	
sl@0
   155
TVariantPtrC::operator TInt()
sl@0
   156
	{
sl@0
   157
	
sl@0
   158
	if (*this==_L("KAlgorithmHashMd2")) return KAlgorithmHashMd2;	
sl@0
   159
	else if (*this==_L("KAlgorithmHashMd5")) return KAlgorithmHashMd5;
sl@0
   160
	else if (*this==_L("KAlgorithmHashSha1")) return KAlgorithmHashSha1;
sl@0
   161
	else if (*this==_L("KAlgorithmHashSha224")) return KAlgorithmHashSha224;
sl@0
   162
	else if (*this==_L("KAlgorithmHashSha256")) return KAlgorithmHashSha256;
sl@0
   163
	else if (*this==_L("KAlgorithmHashSha384")) return KAlgorithmHashSha384;
sl@0
   164
	else if (*this==_L("KAlgorithmHashSha512")) return KAlgorithmHashSha512;
sl@0
   165
	else if (*this==_L("KAlgorithmRandom")) return KAlgorithmRandom;	
sl@0
   166
	else if (*this==_L("KAlgorithmCipherDes")) return KAlgorithmCipherDes;	
sl@0
   167
	else if (*this==_L("KAlgorithmCipher3Des")) return KAlgorithmCipher3Des;
sl@0
   168
	else if (*this==_L("KAlgorithmCipherRc2")) return KAlgorithmCipherRc2;
sl@0
   169
	else if (*this==_L("KAlgorithmCipherArc4")) return KAlgorithmCipherArc4;
sl@0
   170
	else if (*this==_L("KAlgorithmCipherAes")) return KAlgorithmCipherAes;
sl@0
   171
	else if (*this==_L("KAlgorithmCipherRsa")) return KAlgorithmCipherRsa;
sl@0
   172
	else if (*this==_L("KAlgorithmSignerRsa")) return KAlgorithmSignerRsa;
sl@0
   173
	else if (*this==_L("KAlgorithmSignerDsa")) return KAlgorithmSignerDsa; 
sl@0
   174
	else if (*this==_L("KAlgorithmVerifierRsa")) return KAlgorithmVerifierRsa;
sl@0
   175
	else if (*this==_L("KAlgorithmVerifierDsa")) return KAlgorithmVerifierDsa;
sl@0
   176
	else if (*this==_L("KAlgorithmKeyAgreementDH")) return KAlgorithmKeyAgreementDH;
sl@0
   177
	else if (*this==_L("KAlgorithmRSAKeyPairGenerator")) return KAlgorithmRSAKeyPairGenerator;
sl@0
   178
	else if (*this==_L("KAlgorithmDSAKeyPairGenerator")) return KAlgorithmDSAKeyPairGenerator;
sl@0
   179
	else if (*this==_L("KAlgorithmDHKeyPairGenerator")) return KAlgorithmDHKeyPairGenerator;
sl@0
   180
	
sl@0
   181
	else if (*this==_L("KHashInterface")) return KHashInterface;
sl@0
   182
	else if (*this==_L("KRandomInterface")) return KRandomInterface;
sl@0
   183
	else if (*this==_L("KSymmetricCipherInterface")) return KSymmetricCipherInterface;
sl@0
   184
	else if (*this==_L("KAsymmetricCipherInterface")) return KAsymmetricCipherInterface;
sl@0
   185
	else if (*this==_L("KSignerInterface")) return KSignerInterface;
sl@0
   186
	else if (*this==_L("KVerifierInterface")) return KVerifierInterface;
sl@0
   187
	else if (*this==_L("KKeyAgreementInterface")) return KKeyAgreementInterface;
sl@0
   188
	else if (*this==_L("KKeyGeneratorInterface")) return KKeyGeneratorInterface;
sl@0
   189
	else if (*this==_L("KKeypairGeneratorInterface")) return KKeypairGeneratorInterface;
sl@0
   190
	else if (*this==_L("KAsyncHashInterface")) return KAsyncHashInterface;
sl@0
   191
	else if (*this==_L("KAsyncRandomInterface")) return KAsyncRandomInterface;
sl@0
   192
	else if (*this==_L("KAsyncSymmetricCipherInterface")) return KAsyncSymmetricCipherInterface;
sl@0
   193
	else if (*this==_L("KAsyncAsymmetricCipherInterface")) return KAsyncAsymmetricCipherInterface;
sl@0
   194
	else if (*this==_L("KAsyncSignerInterface")) return KAsyncSignerInterface;
sl@0
   195
	else if (*this==_L("KAsyncVerifierInterface")) return KAsyncVerifierInterface;
sl@0
   196
	else if (*this==_L("KAsyncKeyAgreementInterface")) return KAsyncKeyAgreementInterface;
sl@0
   197
	else if (*this==_L("KAsyncKeyGeneratorInterface")) return KAsyncKeyGeneratorInterface;
sl@0
   198
	else if (*this==_L("KAsyncKeypairGeneratorInterface")) return KAsyncKeypairGeneratorInterface;
sl@0
   199
	
sl@0
   200
	else if (*this==_L("KCryptoModeEncrypt")) return KCryptoModeEncrypt;
sl@0
   201
	else if (*this==_L("KCryptoModeDecrypt")) return KCryptoModeDecrypt;
sl@0
   202
	
sl@0
   203
	else if (*this==_L("KOperationModeNone")) return KOperationModeNone;	
sl@0
   204
	else if (*this==_L("KOperationModeECB")) return KOperationModeECB;
sl@0
   205
	else if (*this==_L("KOperationModeCBC")) return KOperationModeCBC;
sl@0
   206
	else if (*this==_L("KOperationModeOFB")) return KOperationModeOFB;
sl@0
   207
	else if (*this==_L("KOperationModeCFB")) return KOperationModeCFB;
sl@0
   208
	else if (*this==_L("KOperationModeCTR")) return KOperationModeCTR;
sl@0
   209
	else if (*this==_L("KHashMode")) return KHashMode;
sl@0
   210
	else if (*this==_L("KHmacMode")) return KHmacMode;
sl@0
   211
	
sl@0
   212
	else if (*this==_L("KPaddingInterface")) return KPaddingInterface;	
sl@0
   213
	else if (*this==_L("KPaddingModeNone")) return KPaddingModeNone;
sl@0
   214
	else if (*this==_L("KPaddingModeSSLv3")) return KPaddingModeSSLv3;
sl@0
   215
	else if (*this==_L("KPaddingModePKCS7")) return KPaddingModePKCS7;
sl@0
   216
	else if (*this==_L("KPaddingModePkcs1_v1_5_Encryption")) return KPaddingModePkcs1_v1_5_Encryption;
sl@0
   217
	else if (*this==_L("KPaddingModePkcs1_v1_5_Signature")) return KPaddingModePkcs1_v1_5_Signature;
sl@0
   218
	
sl@0
   219
	else if (*this==_L("KTestPlugin01Des_1")) return KTestPlugin01Des_1;	
sl@0
   220
	else if (*this==_L("KTestPlugin01Des_2")) return KTestPlugin01Des_2;
sl@0
   221
	else if (*this==_L("KTestPlugin01Des_3")) return KTestPlugin01Des_3;
sl@0
   222
	else if (*this==_L("KTestPlugin01Des_4")) return KTestPlugin01Des_4;
sl@0
   223
	else if (*this==_L("KTestPlugin01Md2_1")) return KTestPlugin01Md2_1;
sl@0
   224
	else if (*this==_L("KTestPlugin01Md2_2")) return KTestPlugin01Md2_2;
sl@0
   225
	else if (*this==_L("KTestPlugin01RsaKeyGen_1")) return KTestPlugin01RsaKeyGen_1;
sl@0
   226
	else if (*this==_L("KTestPlugin01RsaVerifier_1")) return KTestPlugin01RsaVerifier_1;
sl@0
   227
	else if (*this==_L("KTestPlugin01RsaVerifier_2")) return KTestPlugin01RsaVerifier_2;
sl@0
   228
	
sl@0
   229
	else if (*this==_L("KTestPlugin02Random_1")) return KTestPlugin02Random_1;	
sl@0
   230
	else if (*this==_L("KTestPlugin02Md5_1")) return KTestPlugin02Md5_1;
sl@0
   231
	else if (*this==_L("KTestPlugin02Des_1")) return KTestPlugin02Des_1;
sl@0
   232
	else if (*this==_L("KTestPlugin02Des_2")) return KTestPlugin02Des_2;
sl@0
   233
	else if (*this==_L("KTestPlugin02Rsa_1")) return KTestPlugin02Rsa_1;
sl@0
   234
	else if (*this==_L("KTestPlugin02Rsa_2")) return KTestPlugin02Rsa_2;
sl@0
   235
	else if (*this==_L("KTestPlugin02RsaKeyGen_1")) return KTestPlugin02RsaKeyGen_1;
sl@0
   236
	else if (*this==_L("KTestPlugin02DHKeyGen_1")) return KTestPlugin02DHKeyGen_1;
sl@0
   237
	else if (*this==_L("KTestPlugin02RsaSigner_1")) return KTestPlugin02RsaSigner_1;
sl@0
   238
	else if (*this==_L("KTestPlugin02DHKeyAgree_1")) return KTestPlugin02DHKeyAgree_1;
sl@0
   239
	else if (*this==_L("KTestPlugin02Random_2")) return KTestPlugin02Random_2;
sl@0
   240
	
sl@0
   241
	else if (*this==_L("KCryptoPluginMd2")) return KCryptoPluginMd2;	
sl@0
   242
	else if (*this==_L("KCryptoPluginMd5")) return KCryptoPluginMd5;
sl@0
   243
	else if (*this==_L("KCryptoPluginSha1")) return KCryptoPluginSha1;
sl@0
   244
	else if (*this==_L("KCryptoPluginSha224")) return KCryptoPluginSha224;
sl@0
   245
	else if (*this==_L("KCryptoPluginSha256")) return KCryptoPluginSha256;
sl@0
   246
	else if (*this==_L("KCryptoPluginSha384")) return KCryptoPluginSha384;
sl@0
   247
	else if (*this==_L("KCryptoPluginSha512")) return KCryptoPluginSha512;
sl@0
   248
	else if (*this==_L("KCryptoPluginRandom")) return KCryptoPluginRandom;
sl@0
   249
	else if (*this==_L("KCryptoPluginDes")) return KCryptoPluginDes;
sl@0
   250
	else if (*this==_L("KCryptoPlugin3Des")) return KCryptoPlugin3Des;
sl@0
   251
	else if (*this==_L("KCryptoPluginAes")) return KCryptoPluginAes;
sl@0
   252
	else if (*this==_L("KCryptoPluginRc2")) return KCryptoPluginRc2;
sl@0
   253
	else if (*this==_L("KCryptoPluginArc4")) return KCryptoPluginArc4;	
sl@0
   254
	else if (*this==_L("KCryptoPluginRsaCipher")) return KCryptoPluginRsaCipher;
sl@0
   255
	else if (*this==_L("KCryptoPluginRsaSigner")) return KCryptoPluginRsaSigner;
sl@0
   256
	else if (*this==_L("KCryptoPluginDsaSigner")) return KCryptoPluginDsaSigner;
sl@0
   257
	else if (*this==_L("KCryptoPluginRsaVerifier")) return KCryptoPluginRsaVerifier;
sl@0
   258
	else if (*this==_L("KCryptoPluginDsaVerifier")) return KCryptoPluginDsaVerifier;
sl@0
   259
	else if (*this==_L("KCryptoPluginDhKeyAgreement")) return KCryptoPluginDhKeyAgreement;
sl@0
   260
	else if (*this==_L("KCryptoPluginDhKeyPairGen")) return KCryptoPluginDhKeyPairGen;
sl@0
   261
	else if (*this==_L("KCryptoPluginRsaKeyPairGen")) return KCryptoPluginRsaKeyPairGen;
sl@0
   262
	else if (*this==_L("KCryptoPluginDsaKeyPairGen")) return KCryptoPluginDsaKeyPairGen;
sl@0
   263
	
sl@0
   264
	else if (*this==_L("KInterfaceType")) return KInterfaceType;
sl@0
   265
	else if (*this==_L("KAlgorithmType")) return KAlgorithmType;
sl@0
   266
	else if (*this==_L("KImplementationType")) return KImplementationType;
sl@0
   267
	else if (*this==_L("KCreatorNameType")) return KCreatorNameType;
sl@0
   268
	else if (*this==_L("KIsFIPSApprovedType")) return KIsFIPSApprovedType;
sl@0
   269
	else if (*this==_L("KIsHardwareSupportedType")) return KIsHardwareSupportedType;
sl@0
   270
	else if (*this==_L("KMaxConcurrencySupportedType")) return KMaxConcurrencySupportedType;
sl@0
   271
	else if (*this==_L("KLatencyType")) return KLatencyType;
sl@0
   272
	else if (*this==_L("KThroughputType")) return KThroughputType;
sl@0
   273
	else if (*this==_L("KBlockSizeType")) return KBlockSizeType;
sl@0
   274
	else if (*this==_L("KOutputSizeType")) return KOutputSizeType;
sl@0
   275
	else if (*this==_L("KSupportedOperationModesType")) return KSupportedOperationModesType;
sl@0
   276
	else if (*this==_L("KBlockingModeType")) return KBlockingModeType;
sl@0
   277
	else if (*this==_L("KMaximumKeyLengthType")) return KMaximumKeyLengthType;
sl@0
   278
	else if (*this==_L("KSupportedPaddingModesType")) return KSupportedPaddingModesType;
sl@0
   279
	else if (*this==_L("KKeySupportModeType")) return KKeySupportModeType;
sl@0
   280
	else if (*this==_L("KConcurrencyType")) return KConcurrencyType;
sl@0
   281
	else if (*this==_L("KExclusiveUseType")) return KExclusiveUseType;
sl@0
   282
	
sl@0
   283
	else if (*this==_L("KExtendCharType1")) return KExtendCharType1;
sl@0
   284
	else if (*this==_L("KExtendCharType2")) return KExtendCharType2;
sl@0
   285
	else if (*this==_L("KExtendCharType3")) return KExtendCharType3;
sl@0
   286
	
sl@0
   287
	//************************** CUSTOM INTEGERS *******************************
sl@0
   288
	
sl@0
   289
	else if (*this==_L("EOpEqual")) return EOpEqual;
sl@0
   290
	else if (*this==_L("EOpNotEqual")) return EOpNotEqual;
sl@0
   291
	else if (*this==_L("EOpGreaterThan")) return EOpGreaterThan;
sl@0
   292
	else if (*this==_L("EOpLessThan")) return EOpLessThan;
sl@0
   293
	else if (*this==_L("EOpGreaterThanOrEqual")) return EOpGreaterThanOrEqual;
sl@0
   294
	else if (*this==_L("EOpLessThanOrEqual")) return EOpLessThanOrEqual;
sl@0
   295
	else if (*this==_L("EOpAscendingSort")) return EOpAscendingSort;
sl@0
   296
	else if (*this==_L("EOpDescendingSort")) return EOpDescendingSort;	
sl@0
   297
	
sl@0
   298
	else if (*this==_L("ERuleValueInteger")) return ERuleValueInteger;
sl@0
   299
	else if (*this==_L("ERuleValueDes8")) return ERuleValueDes8;
sl@0
   300
	else if (*this==_L("ERuleValueDes16")) return ERuleValueDes16;
sl@0
   301
	else if (*this==_L("ERuleValueBoolean")) return ERuleValueBoolean;
sl@0
   302
	
sl@0
   303
	else if (*this==_L("KMaxTInt")) return KMaxTInt;
sl@0
   304
	else if (*this==_L("NULL")) return NULL;
sl@0
   305
#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
sl@0
   306
	else if (*this==_L("KAlgorithmHashMd4")) return KAlgorithmHashMd4;
sl@0
   307
	else if (*this==_L("KAlgorithmCipherAesXcbcMac96")) return KAlgorithmCipherAesXcbcMac96;
sl@0
   308
	else if (*this==_L("KAlgorithmCipherAesXcbcPrf128")) return KAlgorithmCipherAesXcbcPrf128;
sl@0
   309
	else if (*this==_L("KMacInterface")) return KMacInterface;
sl@0
   310
	else if (*this==_L("KSymmetricCipherMode")) return KSymmetricCipherMode;
sl@0
   311
	else if (*this==_L("KTestPlugin01Aes")) return KTestPlugin01Aes;
sl@0
   312
	else if (*this==_L("KTestPlugin01XcbcMac96")) return KTestPlugin01XcbcMac96;
sl@0
   313
	else if (*this==_L("KTestPlugin01MacMd2_1")) return KTestPlugin01MacMd2_1;
sl@0
   314
	else if (*this==_L("KTestPlugin01MacMd2_2")) return KTestPlugin01MacMd2_2;
sl@0
   315
	else if (*this==_L("KTestPlugin02Aes")) return KTestPlugin02Aes;
sl@0
   316
	else if (*this==_L("KTestPlugin02XcbcMac96")) return KTestPlugin02XcbcMac96;
sl@0
   317
	else if (*this==_L("KTestPlugin02XcbcPrf128")) return KTestPlugin02XcbcPrf128;
sl@0
   318
#endif	
sl@0
   319
	else
sl@0
   320
		{
sl@0
   321
		User::Panic(*this,KErrNotFound);
sl@0
   322
		return 0;	
sl@0
   323
		}	
sl@0
   324
	}
sl@0
   325
	
sl@0
   326
TVariantPtrC::operator const TInt32*() 
sl@0
   327
	{
sl@0
   328
	
sl@0
   329
	if (*this==_L("KHashOperationModes")) return KHashOperationModes;
sl@0
   330
	else if (*this==_L("KDesCryptoModes")) return KDesCryptoModes;
sl@0
   331
	else if (*this==_L("K3DesCryptoModes")) return K3DesCryptoModes;
sl@0
   332
	else if (*this==_L("KAesCryptoModes")) return KAesCryptoModes;
sl@0
   333
	else if (*this==_L("KRc2CryptoModes")) return KRc2CryptoModes;
sl@0
   334
	else if (*this==_L("KArc4CryptoModes")) return KArc4CryptoModes;
sl@0
   335
sl@0
   336
	else if (*this==_L("KDesPaddingModes")) return KDesPaddingModes;
sl@0
   337
	else if (*this==_L("K3DesPaddingModes")) return K3DesPaddingModes;
sl@0
   338
	else if (*this==_L("KAesPaddingModes")) return KAesPaddingModes;
sl@0
   339
	else if (*this==_L("KRc2PaddingModes")) return KRc2PaddingModes;
sl@0
   340
	else if (*this==_L("KArc4PaddingModes")) return KArc4PaddingModes;
sl@0
   341
	else if (*this==_L("KRSACipherPaddingModes")) return KRSACipherPaddingModes;
sl@0
   342
	else if (*this==_L("KRSASignerPaddingModes")) return KRSASignerPaddingModes;
sl@0
   343
	else if (*this==_L("KDSASignerPaddingModes")) return KDSASignerPaddingModes;
sl@0
   344
	else if (*this==_L("KRSAVerifierPaddingModes")) return KRSAVerifierPaddingModes;
sl@0
   345
	else if (*this==_L("KDSAVerifierPaddingModes")) return KDSAVerifierPaddingModes;
sl@0
   346
	
sl@0
   347
	else
sl@0
   348
		{
sl@0
   349
		User::Panic(*this,KErrNotFound);
sl@0
   350
		return 0;	
sl@0
   351
		}
sl@0
   352
	}
sl@0
   353
	
sl@0
   354
TVariantPtrC::operator TRomLitC16() 
sl@0
   355
	{
sl@0
   356
	
sl@0
   357
	if (*this==_L("KSymbian")) return KSymbian;	
sl@0
   358
	else if (*this==_L("KSymbianTestFramework")) return KSymbianTestFramework;
sl@0
   359
	else if (*this==_L("KTestFramework")) return KTestFramework;
sl@0
   360
	else if (*this==_L("KAlternativeName")) return KAlternativeName;
sl@0
   361
	
sl@0
   362
	else if (*this==_L("KMd2Description")) return KMd2Description;	
sl@0
   363
	else if (*this==_L("KMd5Description")) return KMd5Description;
sl@0
   364
	else if (*this==_L("KSha1Description")) return KSha1Description;
sl@0
   365
	else if (*this==_L("KSha224Description")) return KSha224Description;
sl@0
   366
	else if (*this==_L("KSha256Description")) return KSha256Description;
sl@0
   367
	else if (*this==_L("KSha384Description")) return KSha384Description;
sl@0
   368
	else if (*this==_L("KSha512Description")) return KSha512Description;
sl@0
   369
	else if (*this==_L("KHmacMd2Description")) return KHmacMd2Description;
sl@0
   370
	else if (*this==_L("KHmacMd5Description")) return KHmacMd5Description;	
sl@0
   371
	else if (*this==_L("KHmacSha1Description")) return KHmacSha1Description;
sl@0
   372
	else if (*this==_L("KHmacSha224Description")) return KHmacSha224Description;
sl@0
   373
	else if (*this==_L("KHmacSha256Description")) return KHmacSha256Description;
sl@0
   374
	else if (*this==_L("KHmacSha384Description")) return KHmacSha384Description;
sl@0
   375
	else if (*this==_L("KHmacSha512Description")) return KHmacSha512Description;
sl@0
   376
	else if (*this==_L("KRandomDescription")) return KRandomDescription;	
sl@0
   377
	else if (*this==_L("KDesDescription")) return KDesDescription;
sl@0
   378
	else if (*this==_L("K3DesDescription")) return K3DesDescription;	
sl@0
   379
	else if (*this==_L("KAesDescription")) return KAesDescription;
sl@0
   380
	else if (*this==_L("KRC2Description")) return KRC2Description;
sl@0
   381
	else if (*this==_L("KARC4Description")) return KARC4Description;	
sl@0
   382
	else if (*this==_L("KRsaCipherDescription")) return KRsaCipherDescription;
sl@0
   383
	else if (*this==_L("KRsaSignerDescription")) return KRsaSignerDescription;	
sl@0
   384
	else if (*this==_L("KDsaSignerDescription")) return KDsaSignerDescription;
sl@0
   385
	else if (*this==_L("KRsaVerifierDescription")) return KRsaVerifierDescription;	
sl@0
   386
	else if (*this==_L("KDsaVerifierDescription")) return KDsaVerifierDescription;
sl@0
   387
	else if (*this==_L("KDHDescription")) return KDHDescription;	
sl@0
   388
	else if (*this==_L("KSymmetricKeyGeneratorDescription")) return KSymmetricKeyGeneratorDescription;
sl@0
   389
	else if (*this==_L("KKeyPairDescription")) return KKeyPairDescription;
sl@0
   390
#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
sl@0
   391
	else if (*this==_L("KAesXcbcMac96Description")) return KAesXcbcMac96Description;
sl@0
   392
	else if (*this==_L("KAesXcbcPrf128Description")) return KAesXcbcPrf128Description;
sl@0
   393
#endif
sl@0
   394
	else
sl@0
   395
		{
sl@0
   396
		User::Panic(*this,KErrNotFound);
sl@0
   397
		return TRomLitC16();	
sl@0
   398
		}
sl@0
   399
	}
sl@0
   400
	
sl@0
   401
HBufC* TVariantPtrC::HexStringLC()
sl@0
   402
	{
sl@0
   403
	HBufC* parsedString = HBufC::NewLC(this->Length()*2);
sl@0
   404
	TBuf<2> pair;
sl@0
   405
	_LIT(KFormat2,"%02x"); 
sl@0
   406
						    
sl@0
   407
   	for(TInt i = 0; i<this->Length() ; i++)
sl@0
   408
    	{
sl@0
   409
		TInt num  = (*this)[i];
sl@0
   410
    	pair.Format(KFormat2,num);
sl@0
   411
    	parsedString->Des().Append(pair);
sl@0
   412
    	}
sl@0
   413
	    
sl@0
   414
	return parsedString;
sl@0
   415
	}
sl@0
   416