os/security/cryptoservices/certificateandkeymgmt/inc/x509CertExt_v2.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
* X509CERTEXT.H
sl@0
    16
* X509 extensions v2
sl@0
    17
* Common specific extensions:
sl@0
    18
* 1)	basic constraints
sl@0
    19
* 2)	alt name
sl@0
    20
* 3)	key usage
sl@0
    21
* 4)	name constraints
sl@0
    22
* 5)	policy constraints
sl@0
    23
* 6)	policies
sl@0
    24
* 7)	policy mapping
sl@0
    25
* 8)	authority key ID
sl@0
    26
* 9)	subject key ID
sl@0
    27
* 10)	extended key usage
sl@0
    28
* 11)	authority information access
sl@0
    29
* critical extension
sl@0
    30
* 12)   inhibit-any policy 
sl@0
    31
*
sl@0
    32
*/
sl@0
    33
sl@0
    34
sl@0
    35
/**
sl@0
    36
 @file 
sl@0
    37
 @publishedAll
sl@0
    38
 @released
sl@0
    39
*/
sl@0
    40
sl@0
    41
#if !defined (__X509CERTEXT_H__)
sl@0
    42
#define __X509CERTEXT_H__
sl@0
    43
sl@0
    44
#include <e32base.h>
sl@0
    45
#include <e32std.h>
sl@0
    46
#include <x509gn.h>
sl@0
    47
sl@0
    48
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    49
#include <x509bitstring.h>
sl@0
    50
#endif
sl@0
    51
sl@0
    52
class RReadStream;
sl@0
    53
class RWriteStream;
sl@0
    54
class CX509BitString;
sl@0
    55
/** A list of values that defines what an X.509 key can be used for.
sl@0
    56
* These values can be ANDed together if a key has several usages. 
sl@0
    57
* 
sl@0
    58
* @since v7.0 */
sl@0
    59
enum TX509KeyUsage
sl@0
    60
	{
sl@0
    61
	/** A digital signature. */
sl@0
    62
	EX509DigitalSignature,
sl@0
    63
	/** Non repudiation. */
sl@0
    64
	EX509NonRepudiation,
sl@0
    65
	/** Key encipherment. */
sl@0
    66
	EX509KeyEncipherment,
sl@0
    67
	/** Data encipherment. */
sl@0
    68
	EX509DataEncipherment,
sl@0
    69
	/** Key agreement. */
sl@0
    70
	EX509KeyAgreement,
sl@0
    71
	/** Key certificate sign. */
sl@0
    72
	EX509KeyCertSign,
sl@0
    73
	/** CRL sign. */
sl@0
    74
	EX509CRLSign,
sl@0
    75
	/** Encipher only. */
sl@0
    76
	EX509EncipherOnly,
sl@0
    77
	/** Decipher only. */
sl@0
    78
	EX509DecipherOnly
sl@0
    79
	};
sl@0
    80
sl@0
    81
/** X509 Extension OIDs
sl@0
    82
* 
sl@0
    83
* @since v9.5 */
sl@0
    84
sl@0
    85
//OIDS for the extensions we define here...
sl@0
    86
_LIT(KBasicConstraints,"2.5.29.19");
sl@0
    87
_LIT(KSubjectAltName,"2.5.29.17");
sl@0
    88
_LIT(KIssuerAltName,"2.5.29.18");
sl@0
    89
_LIT(KKeyUsage,"2.5.29.15");
sl@0
    90
_LIT(KNameConstraints,"2.5.29.30");
sl@0
    91
_LIT(KPolicyConstraints,"2.5.29.36");
sl@0
    92
_LIT(KCertPolicies,"2.5.29.32");
sl@0
    93
_LIT(KPolicyMapping,"2.5.29.33");
sl@0
    94
_LIT(KAuthorityKeyId,"2.5.29.35");
sl@0
    95
_LIT(KSubjectKeyId,"2.5.29.14");
sl@0
    96
_LIT(KExtendedKeyUsage,"2.5.29.37");
sl@0
    97
_LIT(KAuthorityInfoAccess, "1.3.6.1.5.5.7.1.1");
sl@0
    98
_LIT(KInhibitAnyPolicy, "2.5.29.54");
sl@0
    99
sl@0
   100
// OIDs for access methods
sl@0
   101
_LIT(KAccessMethodOCSP, "1.3.6.1.5.5.7.48.1");
sl@0
   102
sl@0
   103
//deprecated OIDs we might still encounter
sl@0
   104
_LIT(KOldBasicConstraints,"2.5.29.10");
sl@0
   105
_LIT(KOldBasicConstraints2,"2.5.29.13");
sl@0
   106
_LIT(KOldSubjectAltName,"2.5.29.7");
sl@0
   107
_LIT(KOldIssuerAltName,"2.5.29.8");
sl@0
   108
_LIT(KOldNameConstraints,"2.5.29.11");
sl@0
   109
_LIT(KOldPolicyConstraints,"2.5.29.2");
sl@0
   110
_LIT(KOldPolicyConstraints2,"2.5.29.34");
sl@0
   111
_LIT(KOldCertPolicies,"2.5.29.3");
sl@0
   112
_LIT(KOldPolicyMapping,"2.5.29.5");
sl@0
   113
_LIT(KOldAuthorityKeyId,"2.5.29.1");
sl@0
   114
sl@0
   115
// Define OIDs for Symbian certificate constraints.
sl@0
   116
_LIT(KDeviceIdListConstraint,"1.2.826.0.1.1796587.1.1.1.1");
sl@0
   117
_LIT(KSidListConstraint,"1.2.826.0.1.1796587.1.1.1.4");
sl@0
   118
_LIT(KVidListConstraint,"1.2.826.0.1.1796587.1.1.1.5");
sl@0
   119
_LIT(KCapabilitiesConstraint,"1.2.826.0.1.1796587.1.1.1.6");
sl@0
   120
sl@0
   121
//1) basic constraints...
sl@0
   122
sl@0
   123
class CX509ExtensionBase : public CBase
sl@0
   124
/** A certificate extension base class. 
sl@0
   125
* 
sl@0
   126
* @since v6.0 */
sl@0
   127
	{
sl@0
   128
protected:
sl@0
   129
	/** Second-phase constructor.
sl@0
   130
	* 
sl@0
   131
	* @param aBinaryData	The encoded binary representation.
sl@0
   132
	* @param aPos			The position from which to start decoding. */
sl@0
   133
	virtual void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   134
	
sl@0
   135
	/** Implementation for second-phase construction.
sl@0
   136
	* 
sl@0
   137
	* This is called by ConstructL().
sl@0
   138
	* 
sl@0
   139
	* @param aBinaryData	The encoded binary representation. This is the same as
sl@0
   140
	* 						passed to ConstructL().
sl@0
   141
	* @param aPos			The position from which to start decoding. Note that the value
sl@0
   142
	* 						passed points, in effect, to the content, by passing the header data. */
sl@0
   143
	virtual void DoConstructL(const TDesC8& aBinaryData, TInt& aPos) = 0;
sl@0
   144
	};
sl@0
   145
sl@0
   146
class CX509BasicConstraintsExt : public CX509ExtensionBase
sl@0
   147
/** An X.509 certificate extension that defines basic constraints.
sl@0
   148
* 
sl@0
   149
* It indicates whether the certificate belongs to a Certificate Authority or 
sl@0
   150
* an end Entity. 
sl@0
   151
* 
sl@0
   152
* @since v6.0 */
sl@0
   153
	{
sl@0
   154
public:
sl@0
   155
	/** Creates a new CX509BasicConstraintsExt object from the specified 
sl@0
   156
	* buffer containing the binary coded representation.
sl@0
   157
	* 
sl@0
   158
	* @param aBinaryData	The encoded binary representation.
sl@0
   159
	* @return				The new CX509BasicConstraintsExt object. */
sl@0
   160
	IMPORT_C static CX509BasicConstraintsExt* NewL(const TDesC8& aBinaryData);
sl@0
   161
	
sl@0
   162
	/** Creates a new CX509BasicConstraintsExt object from the specified 
sl@0
   163
	* buffer containing the binary coded representation, and puts a pointer to it 
sl@0
   164
	* onto the cleanup stack.
sl@0
   165
	* 
sl@0
   166
	* @param aBinaryData	The encoded binary representation.
sl@0
   167
	* @return				The new CX509BasicConstraintsExt object. */
sl@0
   168
	IMPORT_C static CX509BasicConstraintsExt* NewLC(const TDesC8& aBinaryData);
sl@0
   169
	
sl@0
   170
	/** Creates a new CX509BasicConstraintsExt object from the specified 
sl@0
   171
	* buffer containing the binary coded representation, starting at the specified 
sl@0
   172
	* offset.
sl@0
   173
	* 
sl@0
   174
	* @param aBinaryData	The encoded binary representation.
sl@0
   175
	* @param aPos			The offset position from which to start decoding.
sl@0
   176
	* @return				The new CX509BasicConstraintsExt object. */
sl@0
   177
	IMPORT_C static CX509BasicConstraintsExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   178
	
sl@0
   179
	/** Creates a new CX509BasicConstraintsExt object from the specified 
sl@0
   180
	* buffer containing the binary coded representation, starting at the specified 
sl@0
   181
	* offset, and puts a pointer to it onto the cleanup stack.
sl@0
   182
	*
sl@0
   183
	* @param aBinaryData	The encoded binary representation.
sl@0
   184
	* @param aPos			The offset position from which to start decoding.
sl@0
   185
	* @return				The new CX509BasicConstraintsExt object. */
sl@0
   186
	IMPORT_C static CX509BasicConstraintsExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   187
	
sl@0
   188
	/** Destructor.
sl@0
   189
	* 
sl@0
   190
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
   191
	virtual ~CX509BasicConstraintsExt();
sl@0
   192
	
sl@0
   193
	/** Tests whether the certificate belongs to a Certificate Authority.
sl@0
   194
	* 
sl@0
   195
	* @return	ETrue, if the certificate belongs to a Certificate Authority; 
sl@0
   196
	* 			EFalse, otherwise. */
sl@0
   197
	IMPORT_C TBool IsCA() const;
sl@0
   198
	
sl@0
   199
	/** Gets the maximum number of certificates that can follow this one in the chain.
sl@0
   200
	* 
sl@0
   201
	* @return	The number of certificates. */
sl@0
   202
	IMPORT_C TInt MaxChainLength() const;//0 if not set
sl@0
   203
private:
sl@0
   204
	CX509BasicConstraintsExt();
sl@0
   205
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   206
	TBool iIsCA;
sl@0
   207
	TInt iMaxChainLen;
sl@0
   208
	};
sl@0
   209
sl@0
   210
//2) alt name
sl@0
   211
sl@0
   212
class CX509AltNameExt : public CX509ExtensionBase
sl@0
   213
/** An X.509 certificate extension that defines an alternate name.
sl@0
   214
* 
sl@0
   215
* It appears as an Issuer Alt Name extension or a Subject Alt Name extension 
sl@0
   216
* and is used to contain extra identifying information that will not fit into 
sl@0
   217
* a Distinguished Name.
sl@0
   218
* 
sl@0
   219
* It consists of an array of X.509 General Names.
sl@0
   220
*
sl@0
   221
* @since v6.0 */
sl@0
   222
	{
sl@0
   223
public:
sl@0
   224
	/** Creates a new CX509AltNameExt object from the specified 
sl@0
   225
	* buffer containing the binary coded representation.
sl@0
   226
	*
sl@0
   227
	* @param aBinaryData	The encoded binary representation.
sl@0
   228
	* @return				The new CX509AltNameExt object. */
sl@0
   229
	IMPORT_C static CX509AltNameExt* NewL(const TDesC8& aBinaryData);
sl@0
   230
	
sl@0
   231
	/** Creates a new CX509AltNameExt object from the specified 
sl@0
   232
	* buffer containing the binary coded representation, and puts a pointer to it 
sl@0
   233
	* onto the cleanup stack.
sl@0
   234
	* 
sl@0
   235
	* @param aBinaryData	The encoded binary representation.
sl@0
   236
	* @return				The new CX509AltNameExt object. */
sl@0
   237
	IMPORT_C static CX509AltNameExt* NewLC(const TDesC8& aBinaryData);
sl@0
   238
	
sl@0
   239
	/** Creates a new CX509AltNameExt object from the specified 
sl@0
   240
	* buffer containing the binary coded representation, starting at the specified 
sl@0
   241
	* offset.
sl@0
   242
	* 
sl@0
   243
	* @param aBinaryData	The encoded binary representation.
sl@0
   244
	* @param aPos			The offset position from which to start decoding.
sl@0
   245
	* @return				The new CX509AltNameExt object. */
sl@0
   246
	IMPORT_C static CX509AltNameExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   247
	
sl@0
   248
	/** Creates a new CX509AltNameExt object from the specified 
sl@0
   249
	* buffer containing the binary coded representation, starting at the specified 
sl@0
   250
	* offset, and puts a pointer to it onto the cleanup stack.
sl@0
   251
	* 
sl@0
   252
	* @param aBinaryData	The encoded binary representation.
sl@0
   253
	* @param aPos			The offset position from which to start decoding.
sl@0
   254
	* @return				The new CX509AltNameExt object. */
sl@0
   255
	IMPORT_C static CX509AltNameExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   256
	
sl@0
   257
	/** Destructor.
sl@0
   258
	* 
sl@0
   259
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
   260
	 virtual ~CX509AltNameExt();
sl@0
   261
	
sl@0
   262
	/** Gets a reference to the array of general names that forms the alternate name 
sl@0
   263
	* extension.
sl@0
   264
	* 
sl@0
   265
	* @return	The array of general names. */
sl@0
   266
	IMPORT_C const CArrayPtrFlat<CX509GeneralName>& AltName() const;
sl@0
   267
	
sl@0
   268
	/** Checks whether the corressponding elements of two equally sized arrays of X.509 general names
sl@0
   269
	* match.
sl@0
   270
	*
sl@0
   271
	* @param aExt	An X.509 certificate extension object that defines an alternate name.
sl@0
   272
	* @return		TRUE if all the elements in the arrays match.
sl@0
   273
	*/
sl@0
   274
	IMPORT_C TBool Match(const CX509AltNameExt& aExt) const;
sl@0
   275
private:
sl@0
   276
	CX509AltNameExt();
sl@0
   277
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   278
	CArrayPtrFlat<CX509GeneralName>* iAuthorityName;
sl@0
   279
	};
sl@0
   280
sl@0
   281
class CX509KeyUsageExt : public CX509ExtensionBase
sl@0
   282
/** An X.509 certificate extension that defines the uses to which a key may be put.
sl@0
   283
* 
sl@0
   284
* @since v6.0 */
sl@0
   285
	{
sl@0
   286
public:
sl@0
   287
	/** Creates a new CX509KeyUsageExt object from the specified buffer 
sl@0
   288
	* containing the binary coded representation.
sl@0
   289
	* 
sl@0
   290
	* @param aBinaryData	The encoded binary representation.
sl@0
   291
	* @return				The new CX509KeyUsageExt object. */
sl@0
   292
	IMPORT_C static CX509KeyUsageExt* NewL(const TDesC8& aBinaryData);
sl@0
   293
	
sl@0
   294
	/** Creates a new CX509KeyUsageExt object from the specified buffer 
sl@0
   295
	* containing the binary coded representation, and puts a pointer to it onto 
sl@0
   296
	* the cleanup stack.
sl@0
   297
	* 
sl@0
   298
	* @param aBinaryData	The encoded binary representation.
sl@0
   299
	* @return				The new CX509KeyUsageExt object. */
sl@0
   300
	IMPORT_C static CX509KeyUsageExt* NewLC(const TDesC8& aBinaryData);
sl@0
   301
	
sl@0
   302
	/** Creates a new CX509KeyUsageExt object from the specified buffer 
sl@0
   303
	* containing the binary coded representation, starting at the specified offset.
sl@0
   304
	* 
sl@0
   305
	* @param aBinaryData	The encoded binary representation.
sl@0
   306
	* @param aPos			The offset position from which to start decoding.
sl@0
   307
	* @return				The new CX509KeyUsageExt object. */
sl@0
   308
	IMPORT_C static CX509KeyUsageExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   309
	
sl@0
   310
	/** Creates a new CX509KeyUsageExt object from the specified buffer 
sl@0
   311
	* containing the binary coded representation, starting at the specified offset, 
sl@0
   312
	* and puts a pointer to it onto the cleanup stack.
sl@0
   313
	* 
sl@0
   314
	* @param aBinaryData	The encoded binary representation.
sl@0
   315
	* @param aPos			The offset position from which to start decoding.
sl@0
   316
	* @return				The new CX509KeyUsageExt object. */
sl@0
   317
	IMPORT_C static CX509KeyUsageExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   318
	
sl@0
   319
	/** Destructor.
sl@0
   320
	* 
sl@0
   321
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
   322
	virtual ~CX509KeyUsageExt();
sl@0
   323
	
sl@0
   324
	/** Tests whether a particular usage is set in the extension.
sl@0
   325
	* 
sl@0
   326
	* 
sl@0
   327
	* @param aUsage	The usage.
sl@0
   328
	* @return		ETrue, if the specific usage is set in the extension; EFalse, otherwise. */
sl@0
   329
	IMPORT_C TBool IsSet(TX509KeyUsage aUsage) const;
sl@0
   330
private:
sl@0
   331
	CX509KeyUsageExt();
sl@0
   332
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   333
	CX509BitString* iData;
sl@0
   334
	};
sl@0
   335
sl@0
   336
//4) name constraints
sl@0
   337
sl@0
   338
class CX509GeneralSubtree : public CBase
sl@0
   339
/** Provides access to the general name and the min/max lengths of the subtree. 
sl@0
   340
* 
sl@0
   341
* @since v6.0 */
sl@0
   342
	{
sl@0
   343
public:
sl@0
   344
	/**
sl@0
   345
	 * @internalComponent
sl@0
   346
	 *  
sl@0
   347
	 * Creates a new CX509GeneralSubtree object from the specified buffer containing 
sl@0
   348
	 * the encoded binary representation.
sl@0
   349
	 * 
sl@0
   350
	 * @param aBinaryData	The encoded binary representation. 
sl@0
   351
	 * @return 		The new CX509GeneralSubtree object. 
sl@0
   352
	 **/
sl@0
   353
	static CX509GeneralSubtree* NewL(const TDesC8& aBinaryData);
sl@0
   354
	
sl@0
   355
	/** 
sl@0
   356
	 * @internalComponent
sl@0
   357
	 * 
sl@0
   358
	 * Creates a new CX509GeneralSubtree object from the specified buffer containing 
sl@0
   359
	 * the encoded binary representation, and puts a pointer to it onto the cleanup stack.
sl@0
   360
	 * 
sl@0
   361
	 * @param aBinaryData	The encoded binary representation. 
sl@0
   362
	 * @return 				The new CX509GeneralSubtree object. 
sl@0
   363
	 **/
sl@0
   364
	static CX509GeneralSubtree* NewLC(const TDesC8& aBinaryData);
sl@0
   365
	
sl@0
   366
	/** 
sl@0
   367
	 * @internalComponent
sl@0
   368
	 *
sl@0
   369
	 * Creates a new CX509GeneralSubtree object from the specified buffer containing 
sl@0
   370
	 * the encoded binary representation.
sl@0
   371
	 * 
sl@0
   372
	 * @param aBinaryData	The encoded binary representation.
sl@0
   373
	 * @param aPos			The position from which to start decoding. 
sl@0
   374
	 * @return 				The new CX509GeneralSubtree object. 
sl@0
   375
	 **/
sl@0
   376
	static CX509GeneralSubtree* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   377
	
sl@0
   378
	/** 
sl@0
   379
	 * @internalComponent
sl@0
   380
	 *
sl@0
   381
	 * Creates a new CX509GeneralSubtree object from the specified buffer containing 
sl@0
   382
	 * the encoded binary representation, and puts a pointer to it onto the cleanup stack.
sl@0
   383
	 * 
sl@0
   384
	 * @param aBinaryData	The encoded binary representation.
sl@0
   385
	 * @param aPos			The position from which to start decoding.
sl@0
   386
	 * @return 				The new CX509GeneralSubtree object. 
sl@0
   387
	 **/
sl@0
   388
	static CX509GeneralSubtree* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   389
	
sl@0
   390
	/** Destructor.
sl@0
   391
	* 
sl@0
   392
	* Frees all resources owned by the object. */
sl@0
   393
	virtual ~CX509GeneralSubtree();
sl@0
   394
	
sl@0
   395
	/** Gets the general name.
sl@0
   396
	* 
sl@0
   397
	* @return	The general name. */
sl@0
   398
	IMPORT_C const CX509GeneralName& Name() const;
sl@0
   399
	
sl@0
   400
	/** Gets the minimum distance of the CX509GeneralSubtree object.
sl@0
   401
	* 
sl@0
   402
	* @return	The minimum distance of the CX509GeneralSubtree object. */
sl@0
   403
	IMPORT_C TInt MinDistance() const;
sl@0
   404
	
sl@0
   405
	/** Gets the maximum distance of the CX509GeneralSubtree object.
sl@0
   406
	* 
sl@0
   407
	* @return	The maximum distance of the CX509GeneralSubtree object. */
sl@0
   408
	IMPORT_C TInt MaxDistance() const;
sl@0
   409
private:
sl@0
   410
	CX509GeneralSubtree();
sl@0
   411
	void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   412
	CX509GeneralName* iName;
sl@0
   413
	TInt iMaxDist;
sl@0
   414
	TInt iMinDist;
sl@0
   415
	};
sl@0
   416
sl@0
   417
class CX509NameConstraintsExt : public CX509ExtensionBase
sl@0
   418
/** An X.509 certificate extension that defines constraints on an entity's name.
sl@0
   419
* 
sl@0
   420
* This extension allows Certification Authorities to restrict or prevent the issuing 
sl@0
   421
* of certificates to entities whose names lie within a defined name space. 
sl@0
   422
*
sl@0
   423
*/
sl@0
   424
	{
sl@0
   425
public:
sl@0
   426
	/** Creates a new CX509NameConstraintsExt object from the specified 
sl@0
   427
	* buffer containing the binary coded representation.
sl@0
   428
	* 
sl@0
   429
	* @param aBinaryData	The encoded binary representation.
sl@0
   430
	* @return				The new CX509NameConstraintsExt object. */
sl@0
   431
	IMPORT_C static CX509NameConstraintsExt* NewL(const TDesC8& aBinaryData);
sl@0
   432
	
sl@0
   433
	/** Creates a new CX509NameConstraintsExt object from the specified 
sl@0
   434
	* buffer containing the binary coded representation, and puts a pointer to it 
sl@0
   435
	* onto the cleanup stack.
sl@0
   436
	* 
sl@0
   437
	* @param aBinaryData	The encoded binary representation.
sl@0
   438
	* @return				The new CX509NameConstraintsExt object. */
sl@0
   439
	IMPORT_C static CX509NameConstraintsExt* NewLC(const TDesC8& aBinaryData);
sl@0
   440
	
sl@0
   441
	/** Creates a new CX509NameConstraintsExt object from the specified 
sl@0
   442
	* buffer containing the binary coded representation, starting at the specified offset.
sl@0
   443
	* 
sl@0
   444
	* @param aBinaryData	The encoded binary representation.
sl@0
   445
	* @param aPos			The offset position from which to start decoding.
sl@0
   446
	* @return				The new CX509NameConstraintsExt object. */
sl@0
   447
	IMPORT_C static CX509NameConstraintsExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   448
	
sl@0
   449
	/** Creates a new CX509NameConstraintsExt object from the specified 
sl@0
   450
	* buffer containing the binary coded representation, starting at the specified 
sl@0
   451
	* offset, and puts a pointer to it onto the cleanup stack.
sl@0
   452
	* 
sl@0
   453
	* @param aBinaryData	The encoded binary representation.
sl@0
   454
	* @param aPos			The offset position from which to start decoding.
sl@0
   455
	* @return				The new CX509NameConstraintsExt object. */
sl@0
   456
	IMPORT_C static CX509NameConstraintsExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   457
	
sl@0
   458
	/** Destructor.
sl@0
   459
	* 
sl@0
   460
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
   461
	IMPORT_C ~CX509NameConstraintsExt();
sl@0
   462
	
sl@0
   463
	/** Gets a reference to the array of exclusion subtree names.
sl@0
   464
	* 
sl@0
   465
	* No certificates after this one may contain names within the subtrees specified.
sl@0
   466
	* 
sl@0
   467
	* @return	The excluded subtrees. */
sl@0
   468
	IMPORT_C const CArrayPtrFlat<CX509GeneralSubtree>& ExcludedSubtrees() const;
sl@0
   469
	
sl@0
   470
	/** Gets a reference to the array of permitted subtree names.
sl@0
   471
	* 
sl@0
   472
	* All certificates after this one must contain names within the subtrees specified.
sl@0
   473
	* 
sl@0
   474
	* @return	The permitted subtrees. */
sl@0
   475
	IMPORT_C const CArrayPtrFlat<CX509GeneralSubtree>& PermittedSubtrees() const;
sl@0
   476
private:
sl@0
   477
	CX509NameConstraintsExt();
sl@0
   478
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   479
	void AddSubtreesL(CArrayPtrFlat<CX509GeneralSubtree>& aSubtrees, const TDesC8& aBinaryData);
sl@0
   480
	CArrayPtrFlat<CX509GeneralSubtree>* iExcludedSubtrees;
sl@0
   481
	CArrayPtrFlat<CX509GeneralSubtree>* iPermittedSubtrees;
sl@0
   482
	};
sl@0
   483
sl@0
   484
//5) policy constraints
sl@0
   485
sl@0
   486
class TX509PolicyConstraint
sl@0
   487
/** Defines whether a policy constraint applies.
sl@0
   488
* 
sl@0
   489
* Objects of this type are used by the X.509 certificate extension that constrains 
sl@0
   490
* the use of policies.
sl@0
   491
* 
sl@0
   492
* An object of this type encapsulates two pieces of information:
sl@0
   493
* @li	whether a specific policy applies to subsequent certificates
sl@0
   494
* @li	if a specific policy applies, the number of certificates that can follow the 
sl@0
   495
* 		current one before the policy constraint applies.
sl@0
   496
* 
sl@0
   497
* Enables a CA to constrain the use of policies in two ways: they can enforce 
sl@0
   498
* the appearance of explicit certificate policies in subsequent certificates, 
sl@0
   499
* and prevent policy mapping from being performed. 
sl@0
   500
*
sl@0
   501
*/
sl@0
   502
	{
sl@0
   503
public:
sl@0
   504
	/** 
sl@0
   505
	 * @internalComponent
sl@0
   506
	 *
sl@0
   507
	 * Constructs a TX509PolicyConstraint definition object with the specified requirement 
sl@0
   508
 	 * and countdown values.
sl@0
   509
	 * 
sl@0
   510
	 * @param aRequired	The policy requirement. Set to ETrue, if the policy constraint 
sl@0
   511
	 * 					applies; set to EFalse, otherwise.
sl@0
   512
	 * @param aCountdown	The countdown value. This is the number of certificates that 
sl@0
   513
	 * 					can follow the current one before the constraint applies. 
sl@0
   514
	 *					This only has meaning if the policy constraint applies. 
sl@0
   515
	 **/
sl@0
   516
	TX509PolicyConstraint(TBool aRequired, TInt aCountdown);
sl@0
   517
	
sl@0
   518
	/** 
sl@0
   519
	 * @internalComponent
sl@0
   520
	 *
sl@0
   521
	 * Default constructor.
sl@0
   522
	 * 
sl@0
   523
	 * Sets policy requirement to EFalse and iRequired to EFalse and the iCountdown 
sl@0
   524
	 * to zero. 
sl@0
   525
	 **/
sl@0
   526
	TX509PolicyConstraint();
sl@0
   527
	
sl@0
   528
	/** The policy requirement.
sl@0
   529
	* 
sl@0
   530
	* This has the value ETrue, if the policy constraint applies; EFalse otherwise. */
sl@0
   531
	TBool iRequired;
sl@0
   532
	
sl@0
   533
	/** The count down value.
sl@0
   534
	* 
sl@0
   535
	* Defines the number of certificates that can follow the current one before 
sl@0
   536
	* the policy constraint applies. This has no meaning if the policy constraint 
sl@0
   537
	* does not apply. */
sl@0
   538
	TInt iCountdown;
sl@0
   539
	};
sl@0
   540
sl@0
   541
class CX509PolicyConstraintsExt : public CX509ExtensionBase
sl@0
   542
/** Enables a Certification Authority to constrain the use of policies in two ways:
sl@0
   543
* @li to enforce the appearance of explicit certificate policies in subsequent certificates
sl@0
   544
* @li to prevent policy mapping from being performed.
sl@0
   545
* 
sl@0
   546
* @since v6.0 */
sl@0
   547
	{
sl@0
   548
public:
sl@0
   549
	/** Creates a new CX509PolicyConstraintsExt object from the specified buffer 
sl@0
   550
	* containing the encoded binary representation.
sl@0
   551
	* 
sl@0
   552
	* @param aBinaryData	The encoded binary representation.
sl@0
   553
	* @return				The new CX509PolicyConstraintsExt object. */
sl@0
   554
	IMPORT_C static CX509PolicyConstraintsExt* NewL(const TDesC8& aBinaryData);
sl@0
   555
	
sl@0
   556
	/** Creates a new Policy constraints extension object from the specified buffer 
sl@0
   557
	* containing the encoded binary representation, and puts a pointer to it onto 
sl@0
   558
	* the cleanup stack.
sl@0
   559
	* 
sl@0
   560
	* @param aBinaryData	The encoded binary representation.
sl@0
   561
	* @return				The new CX509PolicyConstraintsExt object. */
sl@0
   562
	IMPORT_C static CX509PolicyConstraintsExt* NewLC(const TDesC8& aBinaryData);
sl@0
   563
	
sl@0
   564
	/** Creates a new CX509PolicyConstraintsExt object from the specified buffer 
sl@0
   565
	* containing the encoded binary representation, starting at the specified offset.
sl@0
   566
	* 
sl@0
   567
	* @param aBinaryData	The encoded binary representation.
sl@0
   568
	* @param aPos			The offset position from which to start decoding.
sl@0
   569
	* @return				The new CX509PolicyConstraintsExt object. */
sl@0
   570
	IMPORT_C static CX509PolicyConstraintsExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   571
	
sl@0
   572
	/** Creates a new CX509PolicyConstraintsExt object from the specified buffer 
sl@0
   573
	* containing the encoded binary representation, and puts a pointer to it onto 
sl@0
   574
	* the cleanup stack.
sl@0
   575
	* 
sl@0
   576
	* @param aBinaryData	The encoded binary representation.
sl@0
   577
	* @param aPos			The offset position from which to start decoding.
sl@0
   578
	* @return				The new CX509PolicyConstraintsExt object. */
sl@0
   579
	IMPORT_C static CX509PolicyConstraintsExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   580
	
sl@0
   581
	/** Destructor.
sl@0
   582
	* 
sl@0
   583
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
   584
	IMPORT_C ~CX509PolicyConstraintsExt();
sl@0
   585
	
sl@0
   586
	/** Gets the explicit policy constraint.
sl@0
   587
	* 
sl@0
   588
	* @return	The explicit policy constraint. */
sl@0
   589
	IMPORT_C TX509PolicyConstraint ExplicitPolicyRequired() const;
sl@0
   590
	
sl@0
   591
	/** Gets the inhibiting policy mapping.
sl@0
   592
	* 
sl@0
   593
	* @return	The inhibiting policy mapping. */
sl@0
   594
	IMPORT_C TX509PolicyConstraint InhibitPolicyMapping() const;
sl@0
   595
private:
sl@0
   596
	CX509PolicyConstraintsExt();
sl@0
   597
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   598
	TX509PolicyConstraint iRequirePolicy;
sl@0
   599
	TX509PolicyConstraint iInhibitPolicyMapping;
sl@0
   600
	};
sl@0
   601
sl@0
   602
//6) policies
sl@0
   603
sl@0
   604
class CX509PolicyQualifierInfo : public CBase
sl@0
   605
/** Gets X.509 policy qualifier information. 
sl@0
   606
* 
sl@0
   607
* @since v6.0 */
sl@0
   608
	{
sl@0
   609
public:
sl@0
   610
	/** 
sl@0
   611
	 * @internalComponent
sl@0
   612
	 *
sl@0
   613
	 * Creates a new CX509PolicyQualifierInfo object from the specified 
sl@0
   614
	 * buffer containing the encoded binary representation.
sl@0
   615
	 * 
sl@0
   616
	 * @param aBinaryData	The encoded binary representation. 
sl@0
   617
	 * @return				The new CX509PolicyQualifierInfo object. 
sl@0
   618
	 **/
sl@0
   619
	static CX509PolicyQualifierInfo* NewL(const TDesC8& aBinaryData);
sl@0
   620
	
sl@0
   621
	/**
sl@0
   622
	 * @internalComponent
sl@0
   623
	 *
sl@0
   624
	 * Creates a new CX509PolicyQualifierInfo object from the specified 
sl@0
   625
	 * buffer containing the encoded binary representation, and puts a pointer to 
sl@0
   626
	 * it onto the cleanup stack.
sl@0
   627
	 * 
sl@0
   628
	 * @param aBinaryData	The encoded binary representation. 
sl@0
   629
	 * @return				The new CX509PolicyQualifierInfo object. 
sl@0
   630
	 **/
sl@0
   631
	static CX509PolicyQualifierInfo* NewLC(const TDesC8& aBinaryData);
sl@0
   632
	
sl@0
   633
	/** 
sl@0
   634
	 * @internalComponent
sl@0
   635
	 *
sl@0
   636
	 * Creates a new CX509PolicyQualifierInfo object from the specified 
sl@0
   637
	 * buffer containing the encoded binary representation.
sl@0
   638
	 * 
sl@0
   639
	 * @param aBinaryData	The encoded binary representation.
sl@0
   640
	 * @param aPos			The position from which to start decoding. 
sl@0
   641
	 * @return				The new CX509PolicyQualifierInfo object. 
sl@0
   642
	 **/
sl@0
   643
	static CX509PolicyQualifierInfo* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   644
	
sl@0
   645
	/** 
sl@0
   646
	 * @internalComponent
sl@0
   647
	 *
sl@0
   648
	 * Creates a new CX509PolicyQualifierInfo object from the specified 
sl@0
   649
	 * buffer containing the encoded binary representation, and puts a pointer to 
sl@0
   650
	 * it onto the cleanup stack.
sl@0
   651
	 * 
sl@0
   652
	 * @param aBinaryData	The encoded binary representation.
sl@0
   653
	 * @param aPos			The position from which to start decoding. 
sl@0
   654
	 * @return				The new CX509PolicyQualifierInfo object. 
sl@0
   655
	 **/
sl@0
   656
	static CX509PolicyQualifierInfo* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   657
	
sl@0
   658
	/** 
sl@0
   659
	 * @internalComponent
sl@0
   660
	 *
sl@0
   661
	 * Creates a new CX509PolicyQualifierInfo object from an existing X.509 
sl@0
   662
	 * Policy Qualifier Information object.
sl@0
   663
	 * 
sl@0
   664
	 * @param aQualifierInfo	The CX509PolicyQualifierInfo object to be copied. 
sl@0
   665
	 * @return				The new CX509PolicyQualifierInfo object. 
sl@0
   666
	 **/
sl@0
   667
	static CX509PolicyQualifierInfo* NewL(const CX509PolicyQualifierInfo& aQualifierInfo);
sl@0
   668
	
sl@0
   669
	/** 
sl@0
   670
	 * @internalComponent
sl@0
   671
	 *
sl@0
   672
	 * Creates a new CX509PolicyQualifierInfo object from an existing X.509 
sl@0
   673
	 * Policy Qualifier Information object, and puts a pointer to it onto the cleanup stack.
sl@0
   674
	 * 
sl@0
   675
	 * @param aQualifierInfo	The CX509PolicyQualifierInfo object to be copied. 
sl@0
   676
	 * @return				The new CX509PolicyQualifierInfo object. 
sl@0
   677
	 **/
sl@0
   678
	static CX509PolicyQualifierInfo* NewLC(const CX509PolicyQualifierInfo& aQualifierInfo);
sl@0
   679
	
sl@0
   680
	/** 
sl@0
   681
	 * @internalComponent
sl@0
   682
	 *
sl@0
   683
	 * Creates a new CX509PolicyQualifierInfo object from a stream.
sl@0
   684
	 * 
sl@0
   685
	 * @return	The new CX509PolicyQualifierInfo object. 
sl@0
   686
	 **/
sl@0
   687
	static CX509PolicyQualifierInfo* NewL(RReadStream& aStream);
sl@0
   688
	
sl@0
   689
	/** 
sl@0
   690
	 * @internalComponent
sl@0
   691
	 *
sl@0
   692
	 * Creates a new CX509PolicyQualifierInfo object from a stream, and puts a pointer to it onto 
sl@0
   693
	 * the cleanup stack.
sl@0
   694
	 * 
sl@0
   695
	 * @return	The new CX509PolicyQualifierInfo object. 
sl@0
   696
	 **/
sl@0
   697
	static CX509PolicyQualifierInfo* NewLC(RReadStream& aStream);
sl@0
   698
	
sl@0
   699
	/** The destructor.
sl@0
   700
	* 
sl@0
   701
	* Frees all resources owned by the object. */
sl@0
   702
	virtual ~CX509PolicyQualifierInfo();
sl@0
   703
	
sl@0
   704
	/** Gets the policy qualifier Id.
sl@0
   705
	* 
sl@0
   706
	* @return	A non-modifiable pointer descriptor representing the policy qualifier Id. */
sl@0
   707
	IMPORT_C TPtrC Id() const;
sl@0
   708
	
sl@0
   709
	/** Gets the policy qualifier data.
sl@0
   710
	* 
sl@0
   711
	* @return	A non-modifiable pointer descriptor representing the policy qualifier data. */
sl@0
   712
	IMPORT_C TPtrC8 Data() const;
sl@0
   713
sl@0
   714
	// Internalization/Externalization
sl@0
   715
  // Externalize. Writes the data out to a stream
sl@0
   716
	/** 
sl@0
   717
	 * @internalComponent
sl@0
   718
	 * 
sl@0
   719
	 * Externalises an object of this class to a write stream.
sl@0
   720
	 *  
sl@0
   721
	 * The presence of this function means that the standard templated operator<<() 
sl@0
   722
	 * can be used to externalise objects of this class.
sl@0
   723
	 * 
sl@0
   724
	 * @param aStream	Stream to which the object should be externalised. 
sl@0
   725
	 **/
sl@0
   726
	void ExternalizeL(RWriteStream& aStream) const;
sl@0
   727
sl@0
   728
	// Internalize. Reads the data from a stream 
sl@0
   729
	/** 
sl@0
   730
	 * @internalComponent
sl@0
   731
	 *
sl@0
   732
	 * Internalises an object of this class from a read stream.
sl@0
   733
	 * 
sl@0
   734
	 * The presence of this function means that the standard templated operator>>() 
sl@0
   735
	 * can be used to internalise objects of this class.
sl@0
   736
	 * 
sl@0
   737
	 * Note that this function has assignment semantics: it replaces the old value 
sl@0
   738
	 * of the object with a new value read from the read stream.	
sl@0
   739
	 * 
sl@0
   740
	 * @param aStream	Stream from which the object should be internalised. 
sl@0
   741
	 **/
sl@0
   742
	void InternalizeL(RReadStream& aStream);
sl@0
   743
	
sl@0
   744
private:
sl@0
   745
	CX509PolicyQualifierInfo();
sl@0
   746
	void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   747
	void ConstructL(const CX509PolicyQualifierInfo& aQualifier);
sl@0
   748
	void ConstructL(RReadStream& aStream);
sl@0
   749
	HBufC* iPolicyQualifierId;
sl@0
   750
	HBufC8* iData; //opaque (this is another any-defined-by, so could be anything)
sl@0
   751
	};
sl@0
   752
sl@0
   753
class CX509CertPolicyInfo : public CBase
sl@0
   754
/** Defines a specific policy followed by a Certification Authority.
sl@0
   755
* 
sl@0
   756
* The policy under which a certificate has been issued may contain a number 
sl@0
   757
* of these specific policies.
sl@0
   758
* 
sl@0
   759
* @see CX509CertPoliciesExt 
sl@0
   760
* @since v6.0 */
sl@0
   761
	{
sl@0
   762
public:
sl@0
   763
	/** 
sl@0
   764
	 * @internalComponent
sl@0
   765
	 *
sl@0
   766
	 * Creates a new CX509CertPolicyInfo object from the specified buffer containing the 
sl@0
   767
	 * binary coded representation.
sl@0
   768
	 * 
sl@0
   769
	 * @param aBinaryData	The encoded binary representation.
sl@0
   770
	 * @return				The new CX509CertPolicyInfo object. 
sl@0
   771
	 **/
sl@0
   772
	static CX509CertPolicyInfo* NewL(const TDesC8& aBinaryData);
sl@0
   773
	
sl@0
   774
	/** 
sl@0
   775
	 * @internalComponent
sl@0
   776
	 *
sl@0
   777
	 * Creates a new CX509CertPolicyInfo object from the specified buffer containing the 
sl@0
   778
	 * binary coded representation, and puts a pointer to it onto the cleanup stack.
sl@0
   779
	 * 
sl@0
   780
	 * @param aBinaryData	The encoded binary representation.
sl@0
   781
	 * @return				The new CX509CertPolicyInfo object. 
sl@0
   782
	 **/
sl@0
   783
	static CX509CertPolicyInfo* NewLC(const TDesC8& aBinaryData);
sl@0
   784
	
sl@0
   785
	/** 
sl@0
   786
	 * @internalComponent
sl@0
   787
	 * Creates a new CX509CertPolicyInfo object from the specified buffer containing the 
sl@0
   788
	 * binary coded representation, starting at the specified offset.
sl@0
   789
	 * 
sl@0
   790
	 * @param aBinaryData	The encoded binary representation.
sl@0
   791
	 * @param aPos			The offset position from which to start decoding.
sl@0
   792
	 * @return				The new CX509CertPolicyInfo object. 
sl@0
   793
	 **/
sl@0
   794
	static CX509CertPolicyInfo* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   795
	
sl@0
   796
	/** 
sl@0
   797
	 * @internalComponent
sl@0
   798
	 * 
sl@0
   799
	 * Creates a new CX509CertPolicyInfo object from the specified buffer containing the 
sl@0
   800
	 * binary coded representation, starting at the specified offset, and puts a 
sl@0
   801
	 * pointer to it onto the cleanup stack.
sl@0
   802
	 * 
sl@0
   803
	 * @param aBinaryData	The encoded binary representation.
sl@0
   804
	 * @param aPos			The offset position from which to start decoding.
sl@0
   805
	 * @return				The new CX509CertPolicyInfo object. 
sl@0
   806
	 **/
sl@0
   807
	static CX509CertPolicyInfo* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   808
	
sl@0
   809
	/** Creates a new CX509CertPolicyInfo object from an existing object.
sl@0
   810
	* 
sl@0
   811
	* This is equivalent to a copy constructor.	
sl@0
   812
	* 
sl@0
   813
	* @param aPolicy		The CX509CertPolicyInfo object to be copied.
sl@0
   814
	* @return				The new CX509CertPolicyInfo object. */
sl@0
   815
	IMPORT_C static CX509CertPolicyInfo* NewL(const CX509CertPolicyInfo& aPolicy);
sl@0
   816
	
sl@0
   817
	/** Creates a new CX509CertPolicyInfo object from an existing object, and puts a pointer 
sl@0
   818
	* to it onto the cleanup stack.	
sl@0
   819
	* 
sl@0
   820
	* This is equivalent to a copy constructor.
sl@0
   821
	* 
sl@0
   822
	* @param aPolicy	The CX509CertPolicyInfo object to be copied.
sl@0
   823
	* @return			The new CX509CertPolicyInfo object. */
sl@0
   824
	IMPORT_C static CX509CertPolicyInfo* NewLC(const CX509CertPolicyInfo& aPolicy);
sl@0
   825
	
sl@0
   826
	/** Creates a new CX509CertPolicyInfo object from a stream. 
sl@0
   827
	* 
sl@0
   828
	* @return	The new CX509CertPolicyInfo object. */
sl@0
   829
	IMPORT_C static CX509CertPolicyInfo* NewL(RReadStream& aStream);
sl@0
   830
	
sl@0
   831
	/** Creates a new CX509CertPolicyInfo object from a stream, and puts a pointer to it onto 
sl@0
   832
	* the cleanup stack.
sl@0
   833
	* 
sl@0
   834
	* @return	The new CX509CertPolicyInfo object. */
sl@0
   835
	IMPORT_C static CX509CertPolicyInfo* NewLC(RReadStream& aStream);
sl@0
   836
	
sl@0
   837
	/** Destructor.
sl@0
   838
	* 
sl@0
   839
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
   840
	virtual ~CX509CertPolicyInfo();
sl@0
   841
	
sl@0
   842
	/** Gets a reference to the array of policy qualifers.
sl@0
   843
	* 
sl@0
   844
	* @return	The array of policy qualifiers. */
sl@0
   845
	IMPORT_C const CArrayPtrFlat<CX509PolicyQualifierInfo>& Qualifiers() const;
sl@0
   846
	
sl@0
   847
	/** Gets the specific policy's Object Identifier (OID).
sl@0
   848
	* 
sl@0
   849
	* @return	A pointer descriptor representing the specific policy's OID. */
sl@0
   850
	IMPORT_C TPtrC Id() const;
sl@0
   851
sl@0
   852
sl@0
   853
	// Internalization/Externalization
sl@0
   854
	// Externalize. Writes the data out to a stream
sl@0
   855
	/** Externalises an object of this class to a write stream.
sl@0
   856
	* 
sl@0
   857
	* The presence of this function means that the standard templated operator<<() 
sl@0
   858
	* can be used to externalise objects of this class.
sl@0
   859
	* 
sl@0
   860
	* @param aStream	Stream to which the object should be externalised. */
sl@0
   861
	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
sl@0
   862
sl@0
   863
	// Internalize. Reads the data from a stream 
sl@0
   864
	/** Internalises an object of this class from a read stream.
sl@0
   865
	* 
sl@0
   866
	* The presence of this function means that the standard templated operator>>() 
sl@0
   867
	* can be used to internalise objects of this class.
sl@0
   868
	* 
sl@0
   869
	* Note that this function has assignment semantics: it replaces the old value 
sl@0
   870
	* of the object with a new value read from the read stream.	
sl@0
   871
	* 
sl@0
   872
	* @param aStream	Stream from which the object should be internalised. */
sl@0
   873
	IMPORT_C void InternalizeL(RReadStream& aStream);
sl@0
   874
	
sl@0
   875
sl@0
   876
private:
sl@0
   877
	CX509CertPolicyInfo();
sl@0
   878
	void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   879
	void ConstructL(const CX509CertPolicyInfo& aInfo);
sl@0
   880
	void ConstructL(RReadStream& aStream);
sl@0
   881
	HBufC* iCertPolicyId;//OID for this policy
sl@0
   882
	CArrayPtrFlat<CX509PolicyQualifierInfo>* iQualifiers;
sl@0
   883
	};
sl@0
   884
sl@0
   885
class CX509CertPoliciesExt : public CX509ExtensionBase
sl@0
   886
/**  The policy under which this certificate has been issued.
sl@0
   887
*
sl@0
   888
* Contains further information on a client's signature.
sl@0
   889
*
sl@0
   890
* @since v6.0 */
sl@0
   891
	{
sl@0
   892
public:
sl@0
   893
	/** Creates a new CX509CertPoliciesExt object from the specified buffer 
sl@0
   894
	* containing the encoded binary representation.
sl@0
   895
	* 
sl@0
   896
	* @param aBinaryData	The encoded binary representation.
sl@0
   897
	* @return				The CX509CertPoliciesExt object. */
sl@0
   898
	IMPORT_C static CX509CertPoliciesExt* NewL(const TDesC8& aBinaryData);
sl@0
   899
	
sl@0
   900
	/** Creates a new CX509CertPoliciesExt object from the specified buffer 
sl@0
   901
	* containing the encoded binary representation, and puts a pointer to it onto 
sl@0
   902
	* the cleanup stack.
sl@0
   903
	* 
sl@0
   904
	* @param aBinaryData	The encoded binary representation.
sl@0
   905
	* @return				The CX509CertPoliciesExt object. */
sl@0
   906
	IMPORT_C static CX509CertPoliciesExt* NewLC(const TDesC8& aBinaryData);
sl@0
   907
	
sl@0
   908
	/** Creates a new CX509CertPoliciesExt object from the specified buffer 
sl@0
   909
	* containing the encoded binary representation, starting at the specified offset.
sl@0
   910
	* 
sl@0
   911
	* @param aBinaryData	The encoded binary representation.
sl@0
   912
	* @param aPos			The offset position from which to start decoding.
sl@0
   913
	* @return				The CX509CertPoliciesExt object. */
sl@0
   914
	IMPORT_C static CX509CertPoliciesExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   915
	
sl@0
   916
	/** Creates a new CX509CertPoliciesExt object from the specified buffer 
sl@0
   917
	* containing the encoded binary representation, and puts a pointer to it onto 
sl@0
   918
	* the cleanup stack.
sl@0
   919
	* 
sl@0
   920
	* @param aBinaryData	The encoded binary representation.
sl@0
   921
	* @param aPos			The offset position from which to start decoding.
sl@0
   922
	* @return				The CX509CertPoliciesExt object. */
sl@0
   923
	IMPORT_C static CX509CertPoliciesExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   924
	
sl@0
   925
	/** Destructor.
sl@0
   926
	* 
sl@0
   927
	* Frees all resources owned by the object. */
sl@0
   928
	virtual ~CX509CertPoliciesExt();
sl@0
   929
	
sl@0
   930
	/** Gets the certificate policy extension information.
sl@0
   931
	* 
sl@0
   932
	* @return	The certificate policy extension information. */
sl@0
   933
	IMPORT_C const CArrayPtrFlat<CX509CertPolicyInfo>& Policies() const;
sl@0
   934
private:
sl@0
   935
	CX509CertPoliciesExt();
sl@0
   936
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   937
	CArrayPtrFlat<CX509CertPolicyInfo>* iPolicies;
sl@0
   938
	};
sl@0
   939
sl@0
   940
//7) policy mapping
sl@0
   941
sl@0
   942
class CX509PolicyMapping : public CBase
sl@0
   943
/** A set of policy mappings. 
sl@0
   944
* 
sl@0
   945
* @since v6.0 */
sl@0
   946
	{
sl@0
   947
public:
sl@0
   948
	/** 
sl@0
   949
	 * @internalComponent
sl@0
   950
	 *
sl@0
   951
	 * Creates a new CX509PolicyMapping object from the specified buffer containing 
sl@0
   952
	 * the encoded binary representation, and puts a pointer to it onto the cleanup stack.
sl@0
   953
	 * 
sl@0
   954
	 * @param aBinaryData	The encoded binary representation. 
sl@0
   955
	 **/
sl@0
   956
	static CX509PolicyMapping* NewL(const TDesC8& aBinaryData);
sl@0
   957
	
sl@0
   958
	/** 
sl@0
   959
	 * @internalComponent
sl@0
   960
	 *
sl@0
   961
	 * Creates a new CX509PolicyMapping object from the specified buffer containing 
sl@0
   962
	 * the encoded binary representation, and puts a pointer to it onto the cleanup stack.
sl@0
   963
	 * 
sl@0
   964
	 * @param aBinaryData	The encoded binary representation. 
sl@0
   965
	 **/
sl@0
   966
	static CX509PolicyMapping* NewLC(const TDesC8& aBinaryData);
sl@0
   967
	
sl@0
   968
	/** 
sl@0
   969
	 * @internalComponent
sl@0
   970
	 *
sl@0
   971
	 * Creates a new CX509PolicyMapping object from the specified buffer containing 
sl@0
   972
	 * the encoded binary representation, starting at the specified offset, and puts 
sl@0
   973
	 * a pointer to it onto the cleanup stack.
sl@0
   974
	 * 
sl@0
   975
	 * @param aBinaryData	The encoded binary representation.
sl@0
   976
	 * @param aPos			The position from which to start decoding. 
sl@0
   977
	 **/
sl@0
   978
	static CX509PolicyMapping* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   979
	
sl@0
   980
	/** 
sl@0
   981
	 * @internalComponent
sl@0
   982
	 * 
sl@0
   983
	 * Creates a new CX509PolicyMapping object from the specified buffer containing 
sl@0
   984
	 * the encoded binary representation, starting at the specified offset, and puts 
sl@0
   985
	 * a pointer to it onto the cleanup stack.
sl@0
   986
	 * 
sl@0
   987
	 * @param aBinaryData	The encoded binary representation.
sl@0
   988
	 * @param aPos			The position from which to start decoding. 
sl@0
   989
	 **/
sl@0
   990
	static CX509PolicyMapping* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
   991
	
sl@0
   992
	/** Creates a new CX509PolicyMapping object copied from an existing one.
sl@0
   993
	* 
sl@0
   994
	* @param aMapping	The CX509PolicyMapping object to be copied. */
sl@0
   995
	IMPORT_C static CX509PolicyMapping* NewL(const CX509PolicyMapping& aMapping);
sl@0
   996
	
sl@0
   997
	/** Creates a new CX509PolicyMapping object copied from an existing one, and 
sl@0
   998
	* puts a pointer to the object onto the cleanup stack.
sl@0
   999
	* 
sl@0
  1000
	* @param aMapping	The CX509PolicyMapping object to be copied. */
sl@0
  1001
	IMPORT_C static CX509PolicyMapping* NewLC(const CX509PolicyMapping& aMapping);
sl@0
  1002
	
sl@0
  1003
	/** The destructor.
sl@0
  1004
	* 
sl@0
  1005
	* Frees all resources owned by the object. */
sl@0
  1006
	virtual ~CX509PolicyMapping();
sl@0
  1007
	
sl@0
  1008
	/** Gets the issuer policy.
sl@0
  1009
	* 
sl@0
  1010
	* @return	The issuer policy. */
sl@0
  1011
	IMPORT_C TPtrC IssuerPolicy() const;
sl@0
  1012
	
sl@0
  1013
	/** Gets the subject policy.
sl@0
  1014
	* 
sl@0
  1015
	* @return	The subject policy. */
sl@0
  1016
	IMPORT_C TPtrC SubjectPolicy() const;
sl@0
  1017
private:
sl@0
  1018
	CX509PolicyMapping();
sl@0
  1019
	void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1020
	void ConstructL(const CX509PolicyMapping& aMapping);
sl@0
  1021
	HBufC* iIssuerPolicy;
sl@0
  1022
	HBufC* iSubjectPolicy;
sl@0
  1023
	};
sl@0
  1024
sl@0
  1025
class CX509PolicyMappingExt : public CX509ExtensionBase
sl@0
  1026
/** An X.509 certificate extension that contains a set of policy mappings.
sl@0
  1027
*
sl@0
  1028
* A policy mapping allows a Certification Authority to declare that two certificate 
sl@0
  1029
* policies are equivalent.
sl@0
  1030
*
sl@0
  1031
* @since v6.0 */
sl@0
  1032
	{
sl@0
  1033
public:
sl@0
  1034
	/** Creates a new CX509PolicyMappingExt object from the specified buffer containing 
sl@0
  1035
	* the binary coded representation.
sl@0
  1036
	* 
sl@0
  1037
	* @param aBinaryData	The encoded binary representation.
sl@0
  1038
	* @return				The new CX509PolicyMappingExt object. */
sl@0
  1039
	IMPORT_C static CX509PolicyMappingExt* NewL(const TDesC8& aBinaryData);
sl@0
  1040
	
sl@0
  1041
	/** Creates a new CX509PolicyMappingExt object from the specified buffer containing 
sl@0
  1042
	* the binary coded representation, and puts a pointer to it onto the cleanup stack.
sl@0
  1043
	* 
sl@0
  1044
	* @param aBinaryData	The encoded binary representation.
sl@0
  1045
	* @return				The new CX509PolicyMappingExt object. */
sl@0
  1046
	IMPORT_C static CX509PolicyMappingExt* NewLC(const TDesC8& aBinaryData);
sl@0
  1047
	
sl@0
  1048
	/** Creates a new CX509PolicyMappingExt object from the specified buffer containing 
sl@0
  1049
	* the binary coded representation, starting at the specified offset.
sl@0
  1050
	* 
sl@0
  1051
	* @param aBinaryData	The encoded binary representation.
sl@0
  1052
	* @param aPos			The offset position from which to start decoding.
sl@0
  1053
	* @return				The new CX509PolicyMappingExt object. */
sl@0
  1054
	IMPORT_C static CX509PolicyMappingExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1055
	
sl@0
  1056
	/** Creates a new CX509PolicyMappingExt object from the specified buffer containing 
sl@0
  1057
	* the binary coded representation, starting at the specified offset, and puts 
sl@0
  1058
	* a pointer to it onto the cleanup stack.
sl@0
  1059
	* 
sl@0
  1060
	* @param aBinaryData	The encoded binary representation.
sl@0
  1061
	* @param aPos			The offset position from which to start decoding.
sl@0
  1062
	* @return				The new CX509PolicyMappingExt object. */
sl@0
  1063
	IMPORT_C static CX509PolicyMappingExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1064
	
sl@0
  1065
	/** Destructor.
sl@0
  1066
	* 
sl@0
  1067
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
  1068
	virtual ~CX509PolicyMappingExt();
sl@0
  1069
	
sl@0
  1070
	/** Gets a reference to the array of policy mappings.
sl@0
  1071
	* 
sl@0
  1072
	* @return	The array of policy mappings. */
sl@0
  1073
	IMPORT_C const CArrayPtrFlat<CX509PolicyMapping>& Mappings() const;
sl@0
  1074
private:
sl@0
  1075
	CX509PolicyMappingExt();
sl@0
  1076
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1077
	CArrayPtrFlat<CX509PolicyMapping>* iPolicies;
sl@0
  1078
	};
sl@0
  1079
sl@0
  1080
//8) authority key ID
sl@0
  1081
sl@0
  1082
class CX509AuthorityKeyIdExt : public CX509ExtensionBase
sl@0
  1083
/** An X.509 certificate extension that provides a way to find the public key corresponding 
sl@0
  1084
* to the private key used to sign the certificate.
sl@0
  1085
* 
sl@0
  1086
* This is referred to as the authority key ID extension.
sl@0
  1087
* 
sl@0
  1088
* The key may be identified by the issuer's name and the issuing certificate's 
sl@0
  1089
* serial number, or by a key identifier value either derived from the public 
sl@0
  1090
* key or by some method of generating unique IDs. 
sl@0
  1091
* 
sl@0
  1092
* @since v6.0 */
sl@0
  1093
	{
sl@0
  1094
public:
sl@0
  1095
	/** Creates a new CX509AuthorityKeyIdExt object from the specified buffer containing 
sl@0
  1096
	* the binary coded representation.
sl@0
  1097
	* 
sl@0
  1098
	* @param aBinaryData	The encoded binary representation.
sl@0
  1099
	* @return				The new CX509AuthorityKeyIdExt object. */
sl@0
  1100
	IMPORT_C static CX509AuthorityKeyIdExt* NewL(const TDesC8& aBinaryData);
sl@0
  1101
	
sl@0
  1102
	/** Creates a new CX509AuthorityKeyIdExt object from the specified buffer containing 
sl@0
  1103
	* the binary coded representation, and puts a pointer to it onto the cleanup stack.
sl@0
  1104
	* 
sl@0
  1105
	* @param aBinaryData	The encoded binary representation.
sl@0
  1106
	* @return				The new CX509AuthorityKeyIdExt object. */
sl@0
  1107
	IMPORT_C static CX509AuthorityKeyIdExt* NewLC(const TDesC8& aBinaryData);
sl@0
  1108
	
sl@0
  1109
	/** Creates a new CX509AuthorityKeyIdExt object from the specified buffer containing 
sl@0
  1110
	* the binary coded representation, starting at the specified offset.
sl@0
  1111
	* 
sl@0
  1112
	* @param aBinaryData	The encoded binary representation.
sl@0
  1113
	* @param aPos			The offset position from which to start decoding.
sl@0
  1114
	* @return				The new CX509AuthorityKeyIdExt object. */
sl@0
  1115
	IMPORT_C static CX509AuthorityKeyIdExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1116
	
sl@0
  1117
	/** Creates a new CX509AuthorityKeyIdExt object from the specified buffer containing 
sl@0
  1118
	* the binary coded representation, starting at the specified offset, and puts 
sl@0
  1119
	* a pointer to it onto the cleanup stack.
sl@0
  1120
	* 
sl@0
  1121
	* @param aBinaryData	The encoded binary representation.
sl@0
  1122
	* @param aPos			The offset position from which to start decoding.
sl@0
  1123
	* @return				The new CX509AuthorityKeyIdExt object. */
sl@0
  1124
	IMPORT_C static CX509AuthorityKeyIdExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1125
	
sl@0
  1126
	/** Destructor.
sl@0
  1127
	* 
sl@0
  1128
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
  1129
	virtual ~CX509AuthorityKeyIdExt();
sl@0
  1130
	
sl@0
  1131
	/** Gets the authority name.
sl@0
  1132
	* 
sl@0
  1133
	* @return	The authority name. */
sl@0
  1134
	IMPORT_C const CArrayPtrFlat<CX509GeneralName>& AuthorityName() const;
sl@0
  1135
	
sl@0
  1136
	/** Gets the authority certificate serial number.
sl@0
  1137
	* 
sl@0
  1138
	* @return	A pointer descriptor representing the authority certificate serial number. */
sl@0
  1139
	IMPORT_C TPtrC8 AuthorityCertSerialNumber() const;
sl@0
  1140
	
sl@0
  1141
	/** Gets the key identifier value.
sl@0
  1142
	* 
sl@0
  1143
	* @return	A pointer descriptor representing the key identifier value. */
sl@0
  1144
	IMPORT_C TPtrC8 KeyId() const;
sl@0
  1145
private:
sl@0
  1146
	CX509AuthorityKeyIdExt();
sl@0
  1147
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1148
	void DecodeNameL(const TDesC8& aBinaryData);
sl@0
  1149
	void DecodeSerialNoL(const TDesC8& aBinaryData);
sl@0
  1150
	void DecodeKeyIdL(const TDesC8& aBinaryData);
sl@0
  1151
	CArrayPtrFlat<CX509GeneralName>* iAuthorityName;
sl@0
  1152
	HBufC8* iAuthorityCertSerialNumber;
sl@0
  1153
	HBufC8* iKeyIdentifier;
sl@0
  1154
	};
sl@0
  1155
sl@0
  1156
//9) subject key ID
sl@0
  1157
sl@0
  1158
class CX509SubjectKeyIdExt : public CX509ExtensionBase
sl@0
  1159
/** An X.509 certificate extension that provides a way of identifying certificates
sl@0
  1160
* that contain a specific public key.
sl@0
  1161
* 
sl@0
  1162
* This is referred to as the subject key ID extension.
sl@0
  1163
* 
sl@0
  1164
* It consists of a key identifier value either derived from the public key or
sl@0
  1165
* by some method of generating unique IDs.
sl@0
  1166
* 
sl@0
  1167
* @since v6.0 */
sl@0
  1168
	{
sl@0
  1169
public:
sl@0
  1170
	/** Creates a new CX509SubjectKeyIdExt object from the specified buffer containing 
sl@0
  1171
	* the binary coded representation.
sl@0
  1172
	* 
sl@0
  1173
	* @param aBinaryData	The encoded binary representation.
sl@0
  1174
	* @return				The new CX509SubjectKeyIdExt object. */
sl@0
  1175
	IMPORT_C static CX509SubjectKeyIdExt* NewL(const TDesC8& aBinaryData);
sl@0
  1176
	
sl@0
  1177
	/** Creates a new CX509SubjectKeyIdExt object from the specified buffer containing 
sl@0
  1178
	* the binary coded representation, and puts a pointer to it onto the cleanup stack.
sl@0
  1179
	* 
sl@0
  1180
	* @param aBinaryData	The encoded binary representation.
sl@0
  1181
	* @return				The new CX509SubjectKeyIdExt object. */
sl@0
  1182
	IMPORT_C static CX509SubjectKeyIdExt* NewLC(const TDesC8& aBinaryData);
sl@0
  1183
	
sl@0
  1184
	/** Creates a new CX509SubjectKeyIdExt object from the specified buffer containing 
sl@0
  1185
	* the binary coded representation, starting at the specified offset.
sl@0
  1186
	* 
sl@0
  1187
	* @param aBinaryData	The encoded binary representation.
sl@0
  1188
	* @param aPos			The offset position from which to start decoding.
sl@0
  1189
	* @return				The new CX509SubjectKeyIdExt object. */
sl@0
  1190
	IMPORT_C static CX509SubjectKeyIdExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1191
	
sl@0
  1192
	/** Creates a new CX509SubjectKeyIdExt object from the specified buffer containing 
sl@0
  1193
	* the binary coded representation, starting at the specified offset, and puts 
sl@0
  1194
	* a pointer to it onto the cleanup stack.
sl@0
  1195
	* 
sl@0
  1196
	* @param aBinaryData	The encoded binary representation.
sl@0
  1197
	* @param aPos			The offset position from which to start decoding.
sl@0
  1198
	* @return				The new CX509SubjectKeyIdExt object. */
sl@0
  1199
	IMPORT_C static CX509SubjectKeyIdExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1200
	
sl@0
  1201
	/** Destructor.
sl@0
  1202
	* 
sl@0
  1203
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
  1204
	IMPORT_C ~CX509SubjectKeyIdExt();
sl@0
  1205
	
sl@0
  1206
	/** Gets the key ID.
sl@0
  1207
	* 
sl@0
  1208
	* @return	A pointer descriptor representing the key ID. */
sl@0
  1209
	IMPORT_C TPtrC8 KeyId() const;
sl@0
  1210
private:
sl@0
  1211
	CX509SubjectKeyIdExt();
sl@0
  1212
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1213
	HBufC8* iKeyIdentifier;
sl@0
  1214
	};
sl@0
  1215
sl@0
  1216
//10) extended key usage
sl@0
  1217
sl@0
  1218
class CX509ExtendedKeyUsageExt : public CX509ExtensionBase
sl@0
  1219
/** An X.509 certificate extension that defines the extra uses to which a key may be put.
sl@0
  1220
* 
sl@0
  1221
* This is referred to as the extended key usage extension. 
sl@0
  1222
* 
sl@0
  1223
* @since v6.0 */
sl@0
  1224
	{
sl@0
  1225
public:
sl@0
  1226
	/** Creates a new CX509ExtendedKeyUsageExt object from the specified buffer 
sl@0
  1227
	* containing the binary coded representation.
sl@0
  1228
	* 
sl@0
  1229
	* @param aBinaryData	The encoded binary data.
sl@0
  1230
	* @return				The new CX509ExtendedKeyUsageExt object. */
sl@0
  1231
	IMPORT_C static CX509ExtendedKeyUsageExt* NewL(const TDesC8& aBinaryData);
sl@0
  1232
	
sl@0
  1233
	/** Creates a new CX509ExtendedKeyUsageExt object from the specified buffer 
sl@0
  1234
	* containing the binary coded representation, and puts a pointer to it onto 
sl@0
  1235
	* the cleanup stack.
sl@0
  1236
	* 
sl@0
  1237
	* @param aBinaryData	The encoded binary representation.
sl@0
  1238
	* @return				The new CX509ExtendedKeyUsageExt object. */
sl@0
  1239
	IMPORT_C static CX509ExtendedKeyUsageExt* NewLC(const TDesC8& aBinaryData);
sl@0
  1240
	
sl@0
  1241
	/** Creates a new CX509ExtendedKeyUsageExt object from the specified buffer 
sl@0
  1242
	* containing the binary coded representation, starting at the specified offset.
sl@0
  1243
	* 
sl@0
  1244
	* @param aBinaryData	The encoded binary representation.
sl@0
  1245
	* @param aPos			The offset position from which to start decoding.
sl@0
  1246
	* @return				The new CX509ExtendedKeyUsageExt object. */
sl@0
  1247
	IMPORT_C static CX509ExtendedKeyUsageExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1248
	
sl@0
  1249
	/** Creates a new CX509ExtendedKeyUsageExt object from the specified buffer 
sl@0
  1250
	* containing the binary coded representation, starting at the specified offset, 
sl@0
  1251
	* and puts a pointer to it onto the cleanup stack.
sl@0
  1252
	* 
sl@0
  1253
	* @param aBinaryData	The encoded binary representation.
sl@0
  1254
	* @param aPos			The offset position from which to start decoding.
sl@0
  1255
	* @return				The new CX509ExtendedKeyUsageExt object. */
sl@0
  1256
	IMPORT_C static CX509ExtendedKeyUsageExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1257
	
sl@0
  1258
	/** Destructor.
sl@0
  1259
	* 
sl@0
  1260
	* Frees all resources owned by the object, prior to its destruction. */
sl@0
  1261
	IMPORT_C ~CX509ExtendedKeyUsageExt();
sl@0
  1262
	
sl@0
  1263
	/** Gets the sequence of Object Ids (OID) that identify the key usages.
sl@0
  1264
	* 
sl@0
  1265
	* The sequence is held in a set of heap descriptors.
sl@0
  1266
	* 
sl@0
  1267
	* @return	A reference to the array of pointers to the heap descriptors that 
sl@0
  1268
	* 	contain the OIDs. */
sl@0
  1269
	IMPORT_C const CArrayPtrFlat<HBufC>& KeyUsages() const;
sl@0
  1270
private:
sl@0
  1271
	CX509ExtendedKeyUsageExt();
sl@0
  1272
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1273
	CArrayPtrFlat<HBufC>* iKeyUsages;
sl@0
  1274
	};
sl@0
  1275
sl@0
  1276
//11) authority information access
sl@0
  1277
sl@0
  1278
class CX509AccessDescription : public CBase
sl@0
  1279
/** This class provides the access method OID and access location as used by X.509 private internet extensions
sl@0
  1280
 * (authority information access).
sl@0
  1281
 *
sl@0
  1282
 */
sl@0
  1283
	{
sl@0
  1284
public:
sl@0
  1285
sl@0
  1286
	/** 
sl@0
  1287
	 * @internalComponent
sl@0
  1288
	 * 
sl@0
  1289
	 * Creates a new CX509AccessDescription object from the specified buffer 
sl@0
  1290
	 * containing the binary coded representation.
sl@0
  1291
	 * 
sl@0
  1292
	 * @param aBinaryData	The encoded binary data.
sl@0
  1293
	 * @return				The new CX509AccessDescription object. 
sl@0
  1294
	 **/
sl@0
  1295
	static CX509AccessDescription* NewL(const TDesC8& aBinaryData);
sl@0
  1296
sl@0
  1297
	/** 
sl@0
  1298
	 * @internalComponent
sl@0
  1299
	 *
sl@0
  1300
	 * Creates a new CX509AccessDescription object from the specified buffer 
sl@0
  1301
	 * containing the binary coded representation, and puts a pointer to it onto 
sl@0
  1302
	 * the cleanup stack.
sl@0
  1303
	 * 
sl@0
  1304
	 * @param aBinaryData	The encoded binary representation.
sl@0
  1305
	 * @return				The new CX509AccessDescription object. 
sl@0
  1306
	 **/
sl@0
  1307
	static CX509AccessDescription* NewLC(const TDesC8& aBinaryData);
sl@0
  1308
sl@0
  1309
	/** 
sl@0
  1310
	 * @internalComponent
sl@0
  1311
	 *
sl@0
  1312
	 * Creates a new CX509AuthInfoAccessExt object from the specified buffer 
sl@0
  1313
	 * containing the binary coded representation, starting at the specified offset.
sl@0
  1314
	 * 
sl@0
  1315
	 * @param aBinaryData	The encoded binary representation.
sl@0
  1316
	 * @param aPos			The offset position from which to start decoding.
sl@0
  1317
	 * @return				The new CX509AuthInfoAccessExt object. 
sl@0
  1318
	 **/
sl@0
  1319
	static CX509AccessDescription* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1320
sl@0
  1321
	/**
sl@0
  1322
	 * @internalComponent
sl@0
  1323
	 *
sl@0
  1324
	 *  Creates a new CX509AccessDescription object from the specified buffer 
sl@0
  1325
	 * containing the binary coded representation, starting at the specified offset, 
sl@0
  1326
	 * and puts a pointer to it onto the cleanup stack.
sl@0
  1327
	 * 
sl@0
  1328
	 * @param aBinaryData	The encoded binary representation.
sl@0
  1329
	 * @param aPos			The offset position from which to start decoding.
sl@0
  1330
	 * @return				The new CX509AccessDescription object. 
sl@0
  1331
	 **/
sl@0
  1332
	static CX509AccessDescription* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1333
sl@0
  1334
	/** Destructor. Frees all resources owned by the object, prior to its destruction. 
sl@0
  1335
	*/
sl@0
  1336
	virtual ~CX509AccessDescription();
sl@0
  1337
sl@0
  1338
	/** Gets the Access Method OID.
sl@0
  1339
	*
sl@0
  1340
	* @return	A non modifiable pointer descriptor to point to the access method OID.
sl@0
  1341
	*/
sl@0
  1342
	IMPORT_C TPtrC Method() const; 
sl@0
  1343
sl@0
  1344
	/** Gets the Access Location field which specifies the location where the additional 
sl@0
  1345
	* information of the CA can be obtained.
sl@0
  1346
	*
sl@0
  1347
	* @return	A reference to access location .
sl@0
  1348
	*/
sl@0
  1349
	IMPORT_C const CX509GeneralName& Location() const;
sl@0
  1350
private:
sl@0
  1351
	CX509AccessDescription();
sl@0
  1352
	void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1353
	HBufC* iMethodId;
sl@0
  1354
	CX509GeneralName* iLocation;
sl@0
  1355
	};
sl@0
  1356
sl@0
  1357
class CX509AuthInfoAccessExt : public CX509ExtensionBase
sl@0
  1358
/** An X.509 certificate extension that defines the authority information access.
sl@0
  1359
 * 
sl@0
  1360
 * 
sl@0
  1361
 */
sl@0
  1362
sl@0
  1363
	{
sl@0
  1364
public:
sl@0
  1365
sl@0
  1366
	/** Creates a new CX509AuthInfoAccessExt object from the specified buffer 
sl@0
  1367
	* containing the binary coded representation.
sl@0
  1368
	* 
sl@0
  1369
	* @param aBinaryData	The encoded binary data.
sl@0
  1370
	* @return				The new CX509AuthInfoAccessExt object. 
sl@0
  1371
	*/
sl@0
  1372
	IMPORT_C static CX509AuthInfoAccessExt* NewL(const TDesC8& aBinaryData);
sl@0
  1373
sl@0
  1374
	/** Creates a new CX509AuthInfoAccessExt object from the specified buffer 
sl@0
  1375
	* containing the binary coded representation, and puts a pointer to it onto 
sl@0
  1376
	* the cleanup stack.
sl@0
  1377
	* 
sl@0
  1378
	* @param aBinaryData	The encoded binary representation.
sl@0
  1379
	* @return				The new CX509AuthInfoAccessExt object. 
sl@0
  1380
	*/
sl@0
  1381
	IMPORT_C static CX509AuthInfoAccessExt* NewLC(const TDesC8& aBinaryData);
sl@0
  1382
sl@0
  1383
	/** Creates a new CX509AuthInfoAccessExt object from the specified buffer 
sl@0
  1384
	* containing the binary coded representation, starting at the specified offset.
sl@0
  1385
	* 
sl@0
  1386
	* @param aBinaryData	The encoded binary representation.
sl@0
  1387
	* @param aPos			The offset position from which to start decoding.
sl@0
  1388
	* @return				The new CX509AuthInfoAccessExt object. 
sl@0
  1389
	*/
sl@0
  1390
	IMPORT_C static CX509AuthInfoAccessExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1391
sl@0
  1392
	/** Creates a new CX509AuthInfoAccessExt object from the specified buffer 
sl@0
  1393
	* containing the binary coded representation, starting at the specified offset, 
sl@0
  1394
	* and puts a pointer to it onto the cleanup stack.
sl@0
  1395
	* 
sl@0
  1396
	* @param aBinaryData	The encoded binary representation.
sl@0
  1397
	* @param aPos			The offset position from which to start decoding.
sl@0
  1398
	* @return				The new CX509AuthInfoAccessExt object. 
sl@0
  1399
	*/
sl@0
  1400
	IMPORT_C static CX509AuthInfoAccessExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1401
sl@0
  1402
	/** Destructor. Frees all resources owned by the object, prior to its destruction. 
sl@0
  1403
	*/
sl@0
  1404
	IMPORT_C ~CX509AuthInfoAccessExt();
sl@0
  1405
sl@0
  1406
	/** Gets the authority access description containing the method and location of additional information of CA ,
sl@0
  1407
	* who issued the certificate in which this extension appears.
sl@0
  1408
	*
sl@0
  1409
	* @return	A reference to the array of pointers to the authority access descriptions.
sl@0
  1410
	*/
sl@0
  1411
	IMPORT_C const CArrayPtrFlat<CX509AccessDescription>& AccessDescriptions() const;
sl@0
  1412
private:
sl@0
  1413
	CX509AuthInfoAccessExt();
sl@0
  1414
	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
sl@0
  1415
	CArrayPtrFlat<CX509AccessDescription>* iAccessDescs;
sl@0
  1416
	};
sl@0
  1417
sl@0
  1418
#endif