os/security/cryptoservices/certificateandkeymgmt/twtlscert/TestChain.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 1998-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 #if !defined(__E32STD_H__)
    20 #include <e32std.h>
    21 #endif
    22 
    23 #if !defined (__BADESCA_H__)
    24 #include <badesca.h>
    25 #endif
    26 
    27 #include <wtlscertchain.h>
    28 
    29 /* Chain Orders:
    30 	1) unstructured text, no T=CA chains
    31 	Canadian Universities
    32 	Waterloo noTCA
    33 	Laurier noTCA
    34 	McMaster noTCA
    35 	Guelph noTCA
    36 
    37 	2) proper x509 text with T=ca
    38 	Canadian Universities
    39 	Waterloo
    40 	McMaster
    41 	Guelph
    42 	Queens
    43 	Ottawa
    44 	Lakehead
    45 	Laurier
    46 
    47 	3) proper structured text with T=ca
    48 	Canadian Hockey Teams
    49 	Toronto Maple Leafs
    50 	Ottawa Senators
    51 	Montreal Canadiens
    52 	Winnipeg Jets (missing common name)
    53 	Vancouver Canucks
    54 */
    55 
    56 class CTestChain : public CBase
    57 	{
    58 public:
    59 	~CTestChain();
    60 	CTestChain();
    61 	virtual void ConstructL();
    62 	CDesCArray* iServerCerts;
    63 	CDesCArray* iServerLabels;
    64 	CDesCArray* iRootCerts;
    65 	CDesCArray* iRootLabels;
    66 	CDesCArray* iExtraCerts;
    67 	CDesCArray* iExtraLabels;
    68 	};
    69 			
    70 class CTestChainBuild : public CTestChain
    71 	{
    72 public:
    73 	static CTestChainBuild* NewL();
    74 	static CTestChainBuild* NewLC();
    75 	~CTestChainBuild();
    76 	HBufC* iCorrectChain;
    77 	};
    78 
    79 class CTestChainValidate : public CTestChain
    80 	{
    81 public:
    82 	static CTestChainValidate* NewL();
    83 	static CTestChainValidate* NewLC();
    84 	void ConstructL();
    85 
    86 	// warning:
    87 	//We have test certificates issued at different times in such a way that test validating
    88 	// these certificates with the same date will result in at least some of them being out
    89 	// of their validity period 
    90 	//Old certificates == 0 and should be validated with a date of July 2000
    91 	//New certificates == 1 and should be validated with a date of July 2002
    92 	//This defaults to 0 in the constructor
    93 	TInt iDateIssued;
    94 
    95 	~CTestChainValidate();
    96 	TWTLSValidationStatus* iError;
    97 	CArrayFixFlat<TWTLSValidationStatus>* iWarnings;
    98 	void AddChainL(const TDesC& aValues);
    99 	void AddIOL(const TDesC& aValues);
   100 	void AddDateIssued(const TDesC& aValues);
   101 private:
   102 	TBool AddRootL(const TDesC& aBuf);
   103 	TBool AddServerL(const TDesC& aBuf);
   104 	};
   105 
   106