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