cryptoservices/certificateandkeymgmt/inc/x509CertExt_v2.h
changeset 8 35751d3474b7
parent 0 2c201484c85f
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
    30 * 12)   inhibit-any policy 
    30 * 12)   inhibit-any policy 
    31 *
    31 *
    32 */
    32 */
    33 
    33 
    34 
    34 
    35 
       
    36 
       
    37 /**
    35 /**
    38  @file 
    36  @file 
    39  @internalAll
    37  @publishedAll
    40  @released
    38  @released
    41 */
    39 */
    42 
    40 
    43 #if !defined (__X509CERTEXT_H__)
    41 #if !defined (__X509CERTEXT_H__)
    44 #define __X509CERTEXT_H__
    42 #define __X509CERTEXT_H__
    45 
    43 
    46 #include <e32base.h>
    44 #include <e32base.h>
    47 #include <e32std.h>
    45 #include <e32std.h>
    48 #include <x509gn.h>
    46 #include <x509gn.h>
    49 
    47 
       
    48 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    49 #include <x509bitstring.h>
       
    50 #endif
    50 
    51 
    51 class RReadStream;
    52 class RReadStream;
    52 class RWriteStream;
    53 class RWriteStream;
    53 
    54 class CX509BitString;
    54 /** X509 Extension OIDs
       
    55 * 
       
    56 * @publishedAll
       
    57 * @released
       
    58 * @since v9.5 */
       
    59 
       
    60 //OIDS for the extensions we define here...
       
    61 _LIT(KBasicConstraints,"2.5.29.19");
       
    62 _LIT(KSubjectAltName,"2.5.29.17");
       
    63 _LIT(KIssuerAltName,"2.5.29.18");
       
    64 _LIT(KKeyUsage,"2.5.29.15");
       
    65 _LIT(KNameConstraints,"2.5.29.30");
       
    66 _LIT(KPolicyConstraints,"2.5.29.36");
       
    67 _LIT(KCertPolicies,"2.5.29.32");
       
    68 _LIT(KPolicyMapping,"2.5.29.33");
       
    69 _LIT(KAuthorityKeyId,"2.5.29.35");
       
    70 _LIT(KSubjectKeyId,"2.5.29.14");
       
    71 _LIT(KExtendedKeyUsage,"2.5.29.37");
       
    72 _LIT(KAuthorityInfoAccess, "1.3.6.1.5.5.7.1.1");
       
    73 _LIT(KInhibitAnyPolicy, "2.5.29.54");
       
    74 
       
    75 // OIDs for access methods
       
    76 _LIT(KAccessMethodOCSP, "1.3.6.1.5.5.7.48.1");
       
    77 
       
    78 //deprecated OIDs we might still encounter
       
    79 _LIT(KOldBasicConstraints,"2.5.29.10");
       
    80 _LIT(KOldBasicConstraints2,"2.5.29.13");
       
    81 _LIT(KOldSubjectAltName,"2.5.29.7");
       
    82 _LIT(KOldIssuerAltName,"2.5.29.8");
       
    83 _LIT(KOldNameConstraints,"2.5.29.11");
       
    84 _LIT(KOldPolicyConstraints,"2.5.29.2");
       
    85 _LIT(KOldPolicyConstraints2,"2.5.29.34");
       
    86 _LIT(KOldCertPolicies,"2.5.29.3");
       
    87 _LIT(KOldPolicyMapping,"2.5.29.5");
       
    88 _LIT(KOldAuthorityKeyId,"2.5.29.1");
       
    89 
       
    90 // Define OIDs for Symbian certificate constraints.
       
    91 _LIT(KDeviceIdListConstraint,"1.2.826.0.1.1796587.1.1.1.1");
       
    92 _LIT(KSidListConstraint,"1.2.826.0.1.1796587.1.1.1.4");
       
    93 _LIT(KVidListConstraint,"1.2.826.0.1.1796587.1.1.1.5");
       
    94 _LIT(KCapabilitiesConstraint,"1.2.826.0.1.1796587.1.1.1.6");
       
    95 
       
    96 //1) basic constraints...
       
    97 
       
    98 class CX509ExtensionBase : public CBase
       
    99 /** A certificate extension base class. 
       
   100 * 
       
   101 * @publishedAll
       
   102 * @released
       
   103 * @since v6.0 */
       
   104 	{
       
   105 protected:
       
   106 	/** Second-phase constructor.
       
   107 	* 
       
   108 	* @param aBinaryData	The encoded binary representation.
       
   109 	* @param aPos			The position from which to start decoding. */
       
   110 	virtual void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
       
   111 	
       
   112 	/** Implementation for second-phase construction.
       
   113 	* 
       
   114 	* This is called by ConstructL().
       
   115 	* 
       
   116 	* @param aBinaryData	The encoded binary representation. This is the same as
       
   117 	* 						passed to ConstructL().
       
   118 	* @param aPos			The position from which to start decoding. Note that the value
       
   119 	* 						passed points, in effect, to the content, by passing the header data. */
       
   120 	virtual void DoConstructL(const TDesC8& aBinaryData, TInt& aPos) = 0;
       
   121 	};
       
   122 
       
   123 class CX509BasicConstraintsExt : public CX509ExtensionBase
       
   124 /** An X.509 certificate extension that defines basic constraints.
       
   125 * 
       
   126 * It indicates whether the certificate belongs to a Certificate Authority or 
       
   127 * an end Entity. 
       
   128 * 
       
   129 * @publishedAll
       
   130 * @released
       
   131 * @since v6.0 */
       
   132 	{
       
   133 public:
       
   134 	/** Creates a new CX509BasicConstraintsExt object from the specified 
       
   135 	* buffer containing the binary coded representation.
       
   136 	* 
       
   137 	* @param aBinaryData	The encoded binary representation.
       
   138 	* @return				The new CX509BasicConstraintsExt object. */
       
   139 	IMPORT_C static CX509BasicConstraintsExt* NewL(const TDesC8& aBinaryData);
       
   140 	
       
   141 	/** Creates a new CX509BasicConstraintsExt object from the specified 
       
   142 	* buffer containing the binary coded representation, and puts a pointer to it 
       
   143 	* onto the cleanup stack.
       
   144 	* 
       
   145 	* @param aBinaryData	The encoded binary representation.
       
   146 	* @return				The new CX509BasicConstraintsExt object. */
       
   147 	IMPORT_C static CX509BasicConstraintsExt* NewLC(const TDesC8& aBinaryData);
       
   148 	
       
   149 	/** Creates a new CX509BasicConstraintsExt object from the specified 
       
   150 	* buffer containing the binary coded representation, starting at the specified 
       
   151 	* offset.
       
   152 	* 
       
   153 	* @param aBinaryData	The encoded binary representation.
       
   154 	* @param aPos			The offset position from which to start decoding.
       
   155 	* @return				The new CX509BasicConstraintsExt object. */
       
   156 	IMPORT_C static CX509BasicConstraintsExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
       
   157 	
       
   158 	/** Creates a new CX509BasicConstraintsExt object from the specified 
       
   159 	* buffer containing the binary coded representation, starting at the specified 
       
   160 	* offset, and puts a pointer to it onto the cleanup stack.
       
   161 	*
       
   162 	* @param aBinaryData	The encoded binary representation.
       
   163 	* @param aPos			The offset position from which to start decoding.
       
   164 	* @return				The new CX509BasicConstraintsExt object. */
       
   165 	IMPORT_C static CX509BasicConstraintsExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
       
   166 	
       
   167 	/** Destructor.
       
   168 	* 
       
   169 	* Frees all resources owned by the object, prior to its destruction. */
       
   170 	virtual ~CX509BasicConstraintsExt();
       
   171 	
       
   172 	/** Tests whether the certificate belongs to a Certificate Authority.
       
   173 	* 
       
   174 	* @return	ETrue, if the certificate belongs to a Certificate Authority; 
       
   175 	* 			EFalse, otherwise. */
       
   176 	IMPORT_C TBool IsCA() const;
       
   177 	
       
   178 	/** Gets the maximum number of certificates that can follow this one in the chain.
       
   179 	* 
       
   180 	* @return	The number of certificates. */
       
   181 	IMPORT_C TInt MaxChainLength() const;//0 if not set
       
   182 private:
       
   183 	CX509BasicConstraintsExt();
       
   184 	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
       
   185 	TBool iIsCA;
       
   186 	TInt iMaxChainLen;
       
   187 	};
       
   188 
       
   189 //2) alt name
       
   190 
       
   191 class CX509AltNameExt : public CX509ExtensionBase
       
   192 /** An X.509 certificate extension that defines an alternate name.
       
   193 * 
       
   194 * It appears as an Issuer Alt Name extension or a Subject Alt Name extension 
       
   195 * and is used to contain extra identifying information that will not fit into 
       
   196 * a Distinguished Name.
       
   197 * 
       
   198 * It consists of an array of X.509 General Names.
       
   199 *
       
   200 * @publishedAll
       
   201 * @released
       
   202 * @since v6.0 */
       
   203 	{
       
   204 public:
       
   205 	/** Creates a new CX509AltNameExt object from the specified 
       
   206 	* buffer containing the binary coded representation.
       
   207 	*
       
   208 	* @param aBinaryData	The encoded binary representation.
       
   209 	* @return				The new CX509AltNameExt object. */
       
   210 	IMPORT_C static CX509AltNameExt* NewL(const TDesC8& aBinaryData);
       
   211 	
       
   212 	/** Creates a new CX509AltNameExt object from the specified 
       
   213 	* buffer containing the binary coded representation, and puts a pointer to it 
       
   214 	* onto the cleanup stack.
       
   215 	* 
       
   216 	* @param aBinaryData	The encoded binary representation.
       
   217 	* @return				The new CX509AltNameExt object. */
       
   218 	IMPORT_C static CX509AltNameExt* NewLC(const TDesC8& aBinaryData);
       
   219 	
       
   220 	/** Creates a new CX509AltNameExt object from the specified 
       
   221 	* buffer containing the binary coded representation, starting at the specified 
       
   222 	* offset.
       
   223 	* 
       
   224 	* @param aBinaryData	The encoded binary representation.
       
   225 	* @param aPos			The offset position from which to start decoding.
       
   226 	* @return				The new CX509AltNameExt object. */
       
   227 	IMPORT_C static CX509AltNameExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
       
   228 	
       
   229 	/** Creates a new CX509AltNameExt object from the specified 
       
   230 	* buffer containing the binary coded representation, starting at the specified 
       
   231 	* offset, and puts a pointer to it onto the cleanup stack.
       
   232 	* 
       
   233 	* @param aBinaryData	The encoded binary representation.
       
   234 	* @param aPos			The offset position from which to start decoding.
       
   235 	* @return				The new CX509AltNameExt object. */
       
   236 	IMPORT_C static CX509AltNameExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
       
   237 	
       
   238 	/** Destructor.
       
   239 	* 
       
   240 	* Frees all resources owned by the object, prior to its destruction. */
       
   241 	 virtual ~CX509AltNameExt();
       
   242 	
       
   243 	/** Gets a reference to the array of general names that forms the alternate name 
       
   244 	* extension.
       
   245 	* 
       
   246 	* @return	The array of general names. */
       
   247 	IMPORT_C const CArrayPtrFlat<CX509GeneralName>& AltName() const;
       
   248 	
       
   249 	/** Checks whether the corressponding elements of two equally sized arrays of X.509 general names
       
   250 	* match.
       
   251 	*
       
   252 	* @param aExt	An X.509 certificate extension object that defines an alternate name.
       
   253 	* @return		TRUE if all the elements in the arrays match.
       
   254 	*/
       
   255 	IMPORT_C TBool Match(const CX509AltNameExt& aExt) const;
       
   256 private:
       
   257 	CX509AltNameExt();
       
   258 	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
       
   259 	CArrayPtrFlat<CX509GeneralName>* iAuthorityName;
       
   260 	};
       
   261 
       
   262 //3) key usage
       
   263 
       
   264 class CX509BitString : public CBase
       
   265 /** An X.509 bit string. 
       
   266 *
       
   267 * @internalTechnology
       
   268 * @released
       
   269 * @since v6.0 */
       
   270 	{
       
   271 public:
       
   272 	/** Destructor.
       
   273 	* 
       
   274 	* Frees all resources owned by the object. */
       
   275 	~CX509BitString();
       
   276 	
       
   277 	/** Tests whether the specified bit is set.
       
   278 	* 
       
   279 	* @param aBit	The offset of the bit to be tested. This is a value relative to 
       
   280 	* 				zero. Any value greater than or equal to the length of the bit 
       
   281 	*				string will always cause EFalse to be returned.
       
   282 	* @return		ETrue, if the bit is set; EFalse, otherwise. */
       
   283 	TBool IsSet(TInt aBit) const;
       
   284 	
       
   285 	/** Creates the X.509 bit string.
       
   286 	* 
       
   287 	* @param aData				A heap descriptor representing the bit string data.
       
   288 	* @param aEffectiveLength	The number of bits in the string. */
       
   289 	CX509BitString(HBufC8* aData, TInt aEffectiveLength);
       
   290 private:
       
   291 	HBufC8* iData;
       
   292 	TInt iLength;
       
   293 	};
       
   294 
       
   295 /** A list of values that defines what an X.509 key can be used for.
    55 /** A list of values that defines what an X.509 key can be used for.
   296 * These values can be ANDed together if a key has several usages. 
    56 * These values can be ANDed together if a key has several usages. 
   297 * 
    57 * 
   298 * @internalTechnology
       
   299 * @since v7.0 */
    58 * @since v7.0 */
   300 enum TX509KeyUsage
    59 enum TX509KeyUsage
   301 	{
    60 	{
   302 	/** A digital signature. */
    61 	/** A digital signature. */
   303 	EX509DigitalSignature,
    62 	EX509DigitalSignature,
   317 	EX509EncipherOnly,
    76 	EX509EncipherOnly,
   318 	/** Decipher only. */
    77 	/** Decipher only. */
   319 	EX509DecipherOnly
    78 	EX509DecipherOnly
   320 	};
    79 	};
   321 
    80 
       
    81 /** X509 Extension OIDs
       
    82 * 
       
    83 * @since v9.5 */
       
    84 
       
    85 //OIDS for the extensions we define here...
       
    86 _LIT(KBasicConstraints,"2.5.29.19");
       
    87 _LIT(KSubjectAltName,"2.5.29.17");
       
    88 _LIT(KIssuerAltName,"2.5.29.18");
       
    89 _LIT(KKeyUsage,"2.5.29.15");
       
    90 _LIT(KNameConstraints,"2.5.29.30");
       
    91 _LIT(KPolicyConstraints,"2.5.29.36");
       
    92 _LIT(KCertPolicies,"2.5.29.32");
       
    93 _LIT(KPolicyMapping,"2.5.29.33");
       
    94 _LIT(KAuthorityKeyId,"2.5.29.35");
       
    95 _LIT(KSubjectKeyId,"2.5.29.14");
       
    96 _LIT(KExtendedKeyUsage,"2.5.29.37");
       
    97 _LIT(KAuthorityInfoAccess, "1.3.6.1.5.5.7.1.1");
       
    98 _LIT(KInhibitAnyPolicy, "2.5.29.54");
       
    99 
       
   100 // OIDs for access methods
       
   101 _LIT(KAccessMethodOCSP, "1.3.6.1.5.5.7.48.1");
       
   102 
       
   103 //deprecated OIDs we might still encounter
       
   104 _LIT(KOldBasicConstraints,"2.5.29.10");
       
   105 _LIT(KOldBasicConstraints2,"2.5.29.13");
       
   106 _LIT(KOldSubjectAltName,"2.5.29.7");
       
   107 _LIT(KOldIssuerAltName,"2.5.29.8");
       
   108 _LIT(KOldNameConstraints,"2.5.29.11");
       
   109 _LIT(KOldPolicyConstraints,"2.5.29.2");
       
   110 _LIT(KOldPolicyConstraints2,"2.5.29.34");
       
   111 _LIT(KOldCertPolicies,"2.5.29.3");
       
   112 _LIT(KOldPolicyMapping,"2.5.29.5");
       
   113 _LIT(KOldAuthorityKeyId,"2.5.29.1");
       
   114 
       
   115 // Define OIDs for Symbian certificate constraints.
       
   116 _LIT(KDeviceIdListConstraint,"1.2.826.0.1.1796587.1.1.1.1");
       
   117 _LIT(KSidListConstraint,"1.2.826.0.1.1796587.1.1.1.4");
       
   118 _LIT(KVidListConstraint,"1.2.826.0.1.1796587.1.1.1.5");
       
   119 _LIT(KCapabilitiesConstraint,"1.2.826.0.1.1796587.1.1.1.6");
       
   120 
       
   121 //1) basic constraints...
       
   122 
       
   123 class CX509ExtensionBase : public CBase
       
   124 /** A certificate extension base class. 
       
   125 * 
       
   126 * @since v6.0 */
       
   127 	{
       
   128 protected:
       
   129 	/** Second-phase constructor.
       
   130 	* 
       
   131 	* @param aBinaryData	The encoded binary representation.
       
   132 	* @param aPos			The position from which to start decoding. */
       
   133 	virtual void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
       
   134 	
       
   135 	/** Implementation for second-phase construction.
       
   136 	* 
       
   137 	* This is called by ConstructL().
       
   138 	* 
       
   139 	* @param aBinaryData	The encoded binary representation. This is the same as
       
   140 	* 						passed to ConstructL().
       
   141 	* @param aPos			The position from which to start decoding. Note that the value
       
   142 	* 						passed points, in effect, to the content, by passing the header data. */
       
   143 	virtual void DoConstructL(const TDesC8& aBinaryData, TInt& aPos) = 0;
       
   144 	};
       
   145 
       
   146 class CX509BasicConstraintsExt : public CX509ExtensionBase
       
   147 /** An X.509 certificate extension that defines basic constraints.
       
   148 * 
       
   149 * It indicates whether the certificate belongs to a Certificate Authority or 
       
   150 * an end Entity. 
       
   151 * 
       
   152 * @since v6.0 */
       
   153 	{
       
   154 public:
       
   155 	/** Creates a new CX509BasicConstraintsExt object from the specified 
       
   156 	* buffer containing the binary coded representation.
       
   157 	* 
       
   158 	* @param aBinaryData	The encoded binary representation.
       
   159 	* @return				The new CX509BasicConstraintsExt object. */
       
   160 	IMPORT_C static CX509BasicConstraintsExt* NewL(const TDesC8& aBinaryData);
       
   161 	
       
   162 	/** Creates a new CX509BasicConstraintsExt object from the specified 
       
   163 	* buffer containing the binary coded representation, and puts a pointer to it 
       
   164 	* onto the cleanup stack.
       
   165 	* 
       
   166 	* @param aBinaryData	The encoded binary representation.
       
   167 	* @return				The new CX509BasicConstraintsExt object. */
       
   168 	IMPORT_C static CX509BasicConstraintsExt* NewLC(const TDesC8& aBinaryData);
       
   169 	
       
   170 	/** Creates a new CX509BasicConstraintsExt object from the specified 
       
   171 	* buffer containing the binary coded representation, starting at the specified 
       
   172 	* offset.
       
   173 	* 
       
   174 	* @param aBinaryData	The encoded binary representation.
       
   175 	* @param aPos			The offset position from which to start decoding.
       
   176 	* @return				The new CX509BasicConstraintsExt object. */
       
   177 	IMPORT_C static CX509BasicConstraintsExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
       
   178 	
       
   179 	/** Creates a new CX509BasicConstraintsExt object from the specified 
       
   180 	* buffer containing the binary coded representation, starting at the specified 
       
   181 	* offset, and puts a pointer to it onto the cleanup stack.
       
   182 	*
       
   183 	* @param aBinaryData	The encoded binary representation.
       
   184 	* @param aPos			The offset position from which to start decoding.
       
   185 	* @return				The new CX509BasicConstraintsExt object. */
       
   186 	IMPORT_C static CX509BasicConstraintsExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
       
   187 	
       
   188 	/** Destructor.
       
   189 	* 
       
   190 	* Frees all resources owned by the object, prior to its destruction. */
       
   191 	virtual ~CX509BasicConstraintsExt();
       
   192 	
       
   193 	/** Tests whether the certificate belongs to a Certificate Authority.
       
   194 	* 
       
   195 	* @return	ETrue, if the certificate belongs to a Certificate Authority; 
       
   196 	* 			EFalse, otherwise. */
       
   197 	IMPORT_C TBool IsCA() const;
       
   198 	
       
   199 	/** Gets the maximum number of certificates that can follow this one in the chain.
       
   200 	* 
       
   201 	* @return	The number of certificates. */
       
   202 	IMPORT_C TInt MaxChainLength() const;//0 if not set
       
   203 private:
       
   204 	CX509BasicConstraintsExt();
       
   205 	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
       
   206 	TBool iIsCA;
       
   207 	TInt iMaxChainLen;
       
   208 	};
       
   209 
       
   210 //2) alt name
       
   211 
       
   212 class CX509AltNameExt : public CX509ExtensionBase
       
   213 /** An X.509 certificate extension that defines an alternate name.
       
   214 * 
       
   215 * It appears as an Issuer Alt Name extension or a Subject Alt Name extension 
       
   216 * and is used to contain extra identifying information that will not fit into 
       
   217 * a Distinguished Name.
       
   218 * 
       
   219 * It consists of an array of X.509 General Names.
       
   220 *
       
   221 * @since v6.0 */
       
   222 	{
       
   223 public:
       
   224 	/** Creates a new CX509AltNameExt object from the specified 
       
   225 	* buffer containing the binary coded representation.
       
   226 	*
       
   227 	* @param aBinaryData	The encoded binary representation.
       
   228 	* @return				The new CX509AltNameExt object. */
       
   229 	IMPORT_C static CX509AltNameExt* NewL(const TDesC8& aBinaryData);
       
   230 	
       
   231 	/** Creates a new CX509AltNameExt object from the specified 
       
   232 	* buffer containing the binary coded representation, and puts a pointer to it 
       
   233 	* onto the cleanup stack.
       
   234 	* 
       
   235 	* @param aBinaryData	The encoded binary representation.
       
   236 	* @return				The new CX509AltNameExt object. */
       
   237 	IMPORT_C static CX509AltNameExt* NewLC(const TDesC8& aBinaryData);
       
   238 	
       
   239 	/** Creates a new CX509AltNameExt object from the specified 
       
   240 	* buffer containing the binary coded representation, starting at the specified 
       
   241 	* offset.
       
   242 	* 
       
   243 	* @param aBinaryData	The encoded binary representation.
       
   244 	* @param aPos			The offset position from which to start decoding.
       
   245 	* @return				The new CX509AltNameExt object. */
       
   246 	IMPORT_C static CX509AltNameExt* NewL(const TDesC8& aBinaryData, TInt& aPos);
       
   247 	
       
   248 	/** Creates a new CX509AltNameExt object from the specified 
       
   249 	* buffer containing the binary coded representation, starting at the specified 
       
   250 	* offset, and puts a pointer to it onto the cleanup stack.
       
   251 	* 
       
   252 	* @param aBinaryData	The encoded binary representation.
       
   253 	* @param aPos			The offset position from which to start decoding.
       
   254 	* @return				The new CX509AltNameExt object. */
       
   255 	IMPORT_C static CX509AltNameExt* NewLC(const TDesC8& aBinaryData, TInt& aPos);
       
   256 	
       
   257 	/** Destructor.
       
   258 	* 
       
   259 	* Frees all resources owned by the object, prior to its destruction. */
       
   260 	 virtual ~CX509AltNameExt();
       
   261 	
       
   262 	/** Gets a reference to the array of general names that forms the alternate name 
       
   263 	* extension.
       
   264 	* 
       
   265 	* @return	The array of general names. */
       
   266 	IMPORT_C const CArrayPtrFlat<CX509GeneralName>& AltName() const;
       
   267 	
       
   268 	/** Checks whether the corressponding elements of two equally sized arrays of X.509 general names
       
   269 	* match.
       
   270 	*
       
   271 	* @param aExt	An X.509 certificate extension object that defines an alternate name.
       
   272 	* @return		TRUE if all the elements in the arrays match.
       
   273 	*/
       
   274 	IMPORT_C TBool Match(const CX509AltNameExt& aExt) const;
       
   275 private:
       
   276 	CX509AltNameExt();
       
   277 	void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
       
   278 	CArrayPtrFlat<CX509GeneralName>* iAuthorityName;
       
   279 	};
       
   280 
   322 class CX509KeyUsageExt : public CX509ExtensionBase
   281 class CX509KeyUsageExt : public CX509ExtensionBase
   323 /** An X.509 certificate extension that defines the uses to which a key may be put.
   282 /** An X.509 certificate extension that defines the uses to which a key may be put.
   324 * 
   283 * 
   325 * @publishedAll
       
   326 * @released
       
   327 * @since v6.0 */
   284 * @since v6.0 */
   328 	{
   285 	{
   329 public:
   286 public:
   330 	/** Creates a new CX509KeyUsageExt object from the specified buffer 
   287 	/** Creates a new CX509KeyUsageExt object from the specified buffer 
   331 	* containing the binary coded representation.
   288 	* containing the binary coded representation.
   364 	* Frees all resources owned by the object, prior to its destruction. */
   321 	* Frees all resources owned by the object, prior to its destruction. */
   365 	virtual ~CX509KeyUsageExt();
   322 	virtual ~CX509KeyUsageExt();
   366 	
   323 	
   367 	/** Tests whether a particular usage is set in the extension.
   324 	/** Tests whether a particular usage is set in the extension.
   368 	* 
   325 	* 
   369 	* @internalTechnology
   326 	* 
   370 	* @param aUsage	The usage.
   327 	* @param aUsage	The usage.
   371 	* @return		ETrue, if the specific usage is set in the extension; EFalse, otherwise. */
   328 	* @return		ETrue, if the specific usage is set in the extension; EFalse, otherwise. */
   372 	IMPORT_C TBool IsSet(TX509KeyUsage aUsage) const;
   329 	IMPORT_C TBool IsSet(TX509KeyUsage aUsage) const;
   373 private:
   330 private:
   374 	CX509KeyUsageExt();
   331 	CX509KeyUsageExt();
   379 //4) name constraints
   336 //4) name constraints
   380 
   337 
   381 class CX509GeneralSubtree : public CBase
   338 class CX509GeneralSubtree : public CBase
   382 /** Provides access to the general name and the min/max lengths of the subtree. 
   339 /** Provides access to the general name and the min/max lengths of the subtree. 
   383 * 
   340 * 
   384 * @publishedAll
       
   385 * @released
       
   386 * @since v6.0 */
   341 * @since v6.0 */
   387 	{
   342 	{
   388 public:
   343 public:
   389 	/**
   344 	/**
   390 	 * @internalComponent
   345 	 * @internalComponent
   463 /** An X.509 certificate extension that defines constraints on an entity's name.
   418 /** An X.509 certificate extension that defines constraints on an entity's name.
   464 * 
   419 * 
   465 * This extension allows Certification Authorities to restrict or prevent the issuing 
   420 * This extension allows Certification Authorities to restrict or prevent the issuing 
   466 * of certificates to entities whose names lie within a defined name space. 
   421 * of certificates to entities whose names lie within a defined name space. 
   467 *
   422 *
   468 * @publishedAll
   423 */
   469 * @released */
       
   470 	{
   424 	{
   471 public:
   425 public:
   472 	/** Creates a new CX509NameConstraintsExt object from the specified 
   426 	/** Creates a new CX509NameConstraintsExt object from the specified 
   473 	* buffer containing the binary coded representation.
   427 	* buffer containing the binary coded representation.
   474 	* 
   428 	* 
   542 * 
   496 * 
   543 * Enables a CA to constrain the use of policies in two ways: they can enforce 
   497 * Enables a CA to constrain the use of policies in two ways: they can enforce 
   544 * the appearance of explicit certificate policies in subsequent certificates, 
   498 * the appearance of explicit certificate policies in subsequent certificates, 
   545 * and prevent policy mapping from being performed. 
   499 * and prevent policy mapping from being performed. 
   546 *
   500 *
   547 * @publishedAll
       
   548 * @released
       
   549 */
   501 */
   550 	{
   502 	{
   551 public:
   503 public:
   552 	/** 
   504 	/** 
   553 	 * @internalComponent
   505 	 * @internalComponent
   589 class CX509PolicyConstraintsExt : public CX509ExtensionBase
   541 class CX509PolicyConstraintsExt : public CX509ExtensionBase
   590 /** Enables a Certification Authority to constrain the use of policies in two ways:
   542 /** Enables a Certification Authority to constrain the use of policies in two ways:
   591 * @li to enforce the appearance of explicit certificate policies in subsequent certificates
   543 * @li to enforce the appearance of explicit certificate policies in subsequent certificates
   592 * @li to prevent policy mapping from being performed.
   544 * @li to prevent policy mapping from being performed.
   593 * 
   545 * 
   594 * @publishedAll
       
   595 * @released
       
   596 * @since v6.0 */
   546 * @since v6.0 */
   597 	{
   547 	{
   598 public:
   548 public:
   599 	/** Creates a new CX509PolicyConstraintsExt object from the specified buffer 
   549 	/** Creates a new CX509PolicyConstraintsExt object from the specified buffer 
   600 	* containing the encoded binary representation.
   550 	* containing the encoded binary representation.
   652 //6) policies
   602 //6) policies
   653 
   603 
   654 class CX509PolicyQualifierInfo : public CBase
   604 class CX509PolicyQualifierInfo : public CBase
   655 /** Gets X.509 policy qualifier information. 
   605 /** Gets X.509 policy qualifier information. 
   656 * 
   606 * 
   657 * @publishedAll
       
   658 * @released
       
   659 * @since v6.0 */
   607 * @since v6.0 */
   660 	{
   608 	{
   661 public:
   609 public:
   662 	/** 
   610 	/** 
   663 	 * @internalComponent
   611 	 * @internalComponent
   807 * 
   755 * 
   808 * The policy under which a certificate has been issued may contain a number 
   756 * The policy under which a certificate has been issued may contain a number 
   809 * of these specific policies.
   757 * of these specific policies.
   810 * 
   758 * 
   811 * @see CX509CertPoliciesExt 
   759 * @see CX509CertPoliciesExt 
   812 * @publishedAll
       
   813 * @released
       
   814 * @since v6.0 */
   760 * @since v6.0 */
   815 	{
   761 	{
   816 public:
   762 public:
   817 	/** 
   763 	/** 
   818 	 * @internalComponent
   764 	 * @internalComponent
   939 class CX509CertPoliciesExt : public CX509ExtensionBase
   885 class CX509CertPoliciesExt : public CX509ExtensionBase
   940 /**  The policy under which this certificate has been issued.
   886 /**  The policy under which this certificate has been issued.
   941 *
   887 *
   942 * Contains further information on a client's signature.
   888 * Contains further information on a client's signature.
   943 *
   889 *
   944 * @publishedAll
       
   945 * @released
       
   946 * @since v6.0 */
   890 * @since v6.0 */
   947 	{
   891 	{
   948 public:
   892 public:
   949 	/** Creates a new CX509CertPoliciesExt object from the specified buffer 
   893 	/** Creates a new CX509CertPoliciesExt object from the specified buffer 
   950 	* containing the encoded binary representation.
   894 	* containing the encoded binary representation.
   996 //7) policy mapping
   940 //7) policy mapping
   997 
   941 
   998 class CX509PolicyMapping : public CBase
   942 class CX509PolicyMapping : public CBase
   999 /** A set of policy mappings. 
   943 /** A set of policy mappings. 
  1000 * 
   944 * 
  1001 * @publishedAll
       
  1002 * @released
       
  1003 * @since v6.0 */
   945 * @since v6.0 */
  1004 	{
   946 	{
  1005 public:
   947 public:
  1006 	/** 
   948 	/** 
  1007 	 * @internalComponent
   949 	 * @internalComponent
  1084 /** An X.509 certificate extension that contains a set of policy mappings.
  1026 /** An X.509 certificate extension that contains a set of policy mappings.
  1085 *
  1027 *
  1086 * A policy mapping allows a Certification Authority to declare that two certificate 
  1028 * A policy mapping allows a Certification Authority to declare that two certificate 
  1087 * policies are equivalent.
  1029 * policies are equivalent.
  1088 *
  1030 *
  1089 * @publishedAll
       
  1090 * @released
       
  1091 * @since v6.0 */
  1031 * @since v6.0 */
  1092 	{
  1032 	{
  1093 public:
  1033 public:
  1094 	/** Creates a new CX509PolicyMappingExt object from the specified buffer containing 
  1034 	/** Creates a new CX509PolicyMappingExt object from the specified buffer containing 
  1095 	* the binary coded representation.
  1035 	* the binary coded representation.
  1147 * 
  1087 * 
  1148 * The key may be identified by the issuer's name and the issuing certificate's 
  1088 * The key may be identified by the issuer's name and the issuing certificate's 
  1149 * serial number, or by a key identifier value either derived from the public 
  1089 * serial number, or by a key identifier value either derived from the public 
  1150 * key or by some method of generating unique IDs. 
  1090 * key or by some method of generating unique IDs. 
  1151 * 
  1091 * 
  1152 * @publishedAll
       
  1153 * @released
       
  1154 * @since v6.0 */
  1092 * @since v6.0 */
  1155 	{
  1093 	{
  1156 public:
  1094 public:
  1157 	/** Creates a new CX509AuthorityKeyIdExt object from the specified buffer containing 
  1095 	/** Creates a new CX509AuthorityKeyIdExt object from the specified buffer containing 
  1158 	* the binary coded representation.
  1096 	* the binary coded representation.
  1224 * This is referred to as the subject key ID extension.
  1162 * This is referred to as the subject key ID extension.
  1225 * 
  1163 * 
  1226 * It consists of a key identifier value either derived from the public key or
  1164 * It consists of a key identifier value either derived from the public key or
  1227 * by some method of generating unique IDs.
  1165 * by some method of generating unique IDs.
  1228 * 
  1166 * 
  1229 * @publishedAll
       
  1230 * @released
       
  1231 * @since v6.0 */
  1167 * @since v6.0 */
  1232 	{
  1168 	{
  1233 public:
  1169 public:
  1234 	/** Creates a new CX509SubjectKeyIdExt object from the specified buffer containing 
  1170 	/** Creates a new CX509SubjectKeyIdExt object from the specified buffer containing 
  1235 	* the binary coded representation.
  1171 	* the binary coded representation.
  1282 class CX509ExtendedKeyUsageExt : public CX509ExtensionBase
  1218 class CX509ExtendedKeyUsageExt : public CX509ExtensionBase
  1283 /** An X.509 certificate extension that defines the extra uses to which a key may be put.
  1219 /** An X.509 certificate extension that defines the extra uses to which a key may be put.
  1284 * 
  1220 * 
  1285 * This is referred to as the extended key usage extension. 
  1221 * This is referred to as the extended key usage extension. 
  1286 * 
  1222 * 
  1287 * @publishedAll
       
  1288 * @released
       
  1289 * @since v6.0 */
  1223 * @since v6.0 */
  1290 	{
  1224 	{
  1291 public:
  1225 public:
  1292 	/** Creates a new CX509ExtendedKeyUsageExt object from the specified buffer 
  1226 	/** Creates a new CX509ExtendedKeyUsageExt object from the specified buffer 
  1293 	* containing the binary coded representation.
  1227 	* containing the binary coded representation.
  1343 
  1277 
  1344 class CX509AccessDescription : public CBase
  1278 class CX509AccessDescription : public CBase
  1345 /** This class provides the access method OID and access location as used by X.509 private internet extensions
  1279 /** This class provides the access method OID and access location as used by X.509 private internet extensions
  1346  * (authority information access).
  1280  * (authority information access).
  1347  *
  1281  *
  1348  * @publishedAll
       
  1349  * @released 
       
  1350  */
  1282  */
  1351 	{
  1283 	{
  1352 public:
  1284 public:
  1353 
  1285 
  1354 	/** 
  1286 	/** 
  1424 
  1356 
  1425 class CX509AuthInfoAccessExt : public CX509ExtensionBase
  1357 class CX509AuthInfoAccessExt : public CX509ExtensionBase
  1426 /** An X.509 certificate extension that defines the authority information access.
  1358 /** An X.509 certificate extension that defines the authority information access.
  1427  * 
  1359  * 
  1428  * 
  1360  * 
  1429  * @publishedAll
       
  1430  * @released
       
  1431  */
  1361  */
  1432 
  1362 
  1433 	{
  1363 	{
  1434 public:
  1364 public:
  1435 
  1365