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