Update contrib.
2 * Copyright (c) 2006-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.
27 #include <test/testexecutestepbase.h>
28 #include "tpkcs7server.h"
30 #include <cmssignerinfo.h>
34 class MPKCS8DecodedKeyPairData;
39 class CCmsSignedObject;
40 class CEncapsulatedContentInfo;
45 The base class for testing CMS data types
47 class CTCmsBaseStep : public CTestStep
52 TVerdict doTestStepL();
53 TVerdict doTestStepPreambleL();
56 HBufC8* readFileL (TPtrC tag);
57 HBufC8* CreateDEREncodingLC(const CASN1EncBase& aEncoding);
58 void OutputResultToFileL(const TDesC8& aSignature);
59 TVerdict doOOMTestL();
60 virtual void doTestL() = 0;
61 TInt CovertContentDataTypeNameToDataType(const TDesC& aDataTypeName);
66 TInt iExpectedDataType;
67 HBufC8* iExpectedEncoding;
73 The class for testing CMS Content Info
75 class CTCmsContentInfoDecodingStep : public CTCmsBaseStep
78 CTCmsContentInfoDecodingStep();
79 ~CTCmsContentInfoDecodingStep();
84 The class for testing CMS data type
86 class CTCmsDataStep : public CTCmsBaseStep
93 void DecodingAndCheckL(TDesC8& aRawData);
97 The class for testing CMS data type Decoding
99 class CTCmsDataDecodingStep : public CTCmsDataStep
102 CTCmsDataDecodingStep();
103 ~CTCmsDataDecodingStep();
108 The base class for testing CMS signed data and PKCS7 signed data
109 encoding, decoding and validation. OOM test is configurable in this
112 class CTSignedDataBaseStep : public CTCmsBaseStep
115 CTSignedDataBaseStep();
116 ~CTSignedDataBaseStep();
117 TVerdict doTestStepPreambleL();
120 CMessageDigest* CreateHashLC(TAlgorithmId aAlgorithmId);
121 TInt CovertHashNameToAlgorithmId(const TDesC& aHashName);
122 TInt CovertCertificateNameToCertificateType(const TDesC& aCertificateName);
125 RPointerArray<CDecPKCS8Data> iDecPKCS8Data;
126 RPointerArray<CX509Certificate> iCertificates;
127 RArray<TInt> iSignerInfoVersion;
128 RArray<TInt> iHashName;
129 RArray<TBool> iValidateResults;
130 RArray<TBool> iSignedAttributePresent;
131 RArray<TBool> iUnSignedAttributePresent;
133 TBool iIsHashAvailable;
135 TBool iTwoStepCreation;
137 TBool iCertificateSetPresent;
138 TBool iCRLsSetPresent;
139 TInt iSignedDataVersion;
140 TInt iAlgorithmCount;
143 CX509Certificate* iRootCertificate;
144 CX509Certificate* iAdditionalCertificate;
146 TBool iValidateUsingUserCerts;
148 TInt iAdditionalEncodedCertificateType;
149 HBufC8* iAdditionalEncodedCertificate;
150 TBool iNoValidationTest;
151 TBool iValidationDetachedWithoutInput;
155 The class test encoding, decoding and validation of the CMS signed data object
157 class CTCmsSignedDataStep : public CTSignedDataBaseStep
160 CTCmsSignedDataStep();
161 ~CTCmsSignedDataStep();
165 void CheckAndValidateSignedDataL(TDesC8& aRawData);
166 void CheckSignedDataFieldsL(const CCmsSignedObject& aSignedData);
167 void CheckEncapsulatedContentFieldsL(const CEncapsulatedContentInfo& encapContentInfo);
168 void CheckAlgorithmSetFieldsL(const RPointerArray<CX509AlgorithmIdentifier>& aAlgorithms);
169 void CheckCertificateSetFieldsL(const CCmsSignedObject& aSignedData);
170 void CheckSignerInfoFieldsL(const RPointerArray<CCmsSignerInfo>& signerInfos);
174 The class test decoding and validation of the CMS signed data object
176 class CTCmsSignedDataDecodingStep : public CTCmsSignedDataStep
179 CTCmsSignedDataDecodingStep();
180 ~CTCmsSignedDataDecodingStep();