epoc32/include/x509gn.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/x509gn.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/x509gn.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,603 @@
     1.4 -x509gn.h
     1.5 +/*
     1.6 +* Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Eclipse Public License v1.0"
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: 
    1.19 +* X509 general name class
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +
    1.25 +
    1.26 +/**
    1.27 + @file 
    1.28 + @publishedAll
    1.29 + @released
    1.30 +*/
    1.31 +
    1.32 +#ifndef __X509GN_H__
    1.33 +#define __X509GN_H__
    1.34 +
    1.35 +#include <e32std.h>
    1.36 +#include <badesca.h>
    1.37 +
    1.38 +/** A general name type.
    1.39 + * 
    1.40 + * @publishedAll
    1.41 + * @released
    1.42 + */
    1.43 +typedef TUint TGNType;
    1.44 +
    1.45 +/**
    1.46 + * @publishedAll
    1.47 + * @released
    1.48 + */
    1.49 +enum 
    1.50 +	{
    1.51 +	EX509RFC822Name = 1,
    1.52 +	EX509DNSName = 2,
    1.53 +	EX509DirectoryName = 4,
    1.54 +	EX509URI = 6,
    1.55 +	EX509IPAddress = 7
    1.56 +	};
    1.57 +//specific name forms we support...
    1.58 +//we should probably put these in a file of their own,
    1.59 +//but they can stay here for now
    1.60 +
    1.61 +//superclass
    1.62 +
    1.63 +class CX509DomainName : public CBase
    1.64 +/** An X.509 domain name.
    1.65 +* 
    1.66 +* Base class for email address and DNS names. 
    1.67 +* 
    1.68 +* @publishedAll
    1.69 +* @released
    1.70 +* @since v6.0 */
    1.71 +	{
    1.72 +public:
    1.73 +	/** Destructor.
    1.74 +	* 
    1.75 +	* Frees all resources owned by the object, prior to its destruction. */
    1.76 +	IMPORT_C ~CX509DomainName();
    1.77 +	
    1.78 +	/** Tests whether every sub domain in the specified domain name is the same as 
    1.79 +	* the corresponding sub domain in this object, starting at the end.
    1.80 +	* 
    1.81 +	* For example, 'john.doe@symbian.com' is within the subtree 'symbian.com' but 
    1.82 +	* is not within the subtree 'john' or 'symbian'.
    1.83 +	* 
    1.84 +	* @param aName	The domain name.
    1.85 +	* @return		ETrue, if every sub domain in the specified domain name is the same 
    1.86 +					as the corresponding sub domain in this object; EFalse, otherwise. */
    1.87 +	IMPORT_C TBool IsWithinSubtree(const CX509DomainName& aName) const;
    1.88 +	
    1.89 +	/** Gets the full domain name.
    1.90 +	* 
    1.91 +	* @return	A pointer descriptor representing the full domain name. */
    1.92 +	IMPORT_C TPtrC Name() const;
    1.93 +protected:
    1.94 +	/** Adds a domain by its subdomains to an array of pointer descriptors.
    1.95 +	* 
    1.96 +	* @param aPos	The position within the domain name.
    1.97 +	* @return		ETrue if the domain has been added; EFalse, otherwise. 
    1.98 +	* @internalAll
    1.99 +	*/
   1.100 +	TBool AddDomainL(TInt& aPos);
   1.101 +	
   1.102 +	/** Adds a subdomain to an array of pointer descriptors.
   1.103 +	* 
   1.104 +	* @param aPos	The position within the domain name.
   1.105 +	* @return		ETrue if the subdomain has been added; EFalse, otherwise. 
   1.106 +	* @internalAll
   1.107 +	*/
   1.108 +	TBool AddSubdomainL(TInt& aPos);
   1.109 +	
   1.110 +	/** Adds a subdomain separator after each subdomain entry in an array of pointer 
   1.111 +	* descriptors that represent the subdomains of the domain name.
   1.112 +	* 
   1.113 +	* @param aPos	The position within the domain name.
   1.114 +	* @return		ETrue if the subdomain separator has been added; EFalse, otherwise. 
   1.115 +	* @internalAll
   1.116 +	*/
   1.117 +	TBool AddSubdomainSeparatorL(TInt& aPos);
   1.118 +	
   1.119 +	/** Validates a string.
   1.120 +	* 
   1.121 +	* @param aStr	The string to be verified.
   1.122 +	* @return		ETrue if the string is valid; EFalse, otherwise.*/
   1.123 +	virtual TBool IsValidString(const TDesC& aStr) const;
   1.124 +	
   1.125 +	/** Validates a character.
   1.126 +	* 
   1.127 +	* @param aChar	The character to be validated.
   1.128 +	* @return		ETrue if the character is valid; EFalse, otherwise. */
   1.129 +	virtual TBool IsValidChar(const TChar& aChar) const;
   1.130 +	
   1.131 +	/** Tests whether a character is a letter or a numeral.
   1.132 +	* 
   1.133 +	* @param aChar	The character to be tested.
   1.134 +	* @return		ETrue if the character is a letter or a numeral; EFalse, otherwise. 
   1.135 +	* @internalAll
   1.136 +	*/
   1.137 +	TBool IsAlphaOrNum(const TChar& aChar) const;
   1.138 +	
   1.139 +	/** Tests whether the character is a letter.
   1.140 +	* 
   1.141 +	* @param aChar	The character to be tested.
   1.142 +	* @return		ETrue if the character is a letter; EFalse, otherwise. 
   1.143 +	* @internalAll
   1.144 +	*/
   1.145 +	TBool IsAlpha(const TChar& aChar) const;
   1.146 +	
   1.147 +	/** Default constructor. 
   1.148 +	 * @internalAll
   1.149 +	 */
   1.150 +	CX509DomainName();
   1.151 +protected:
   1.152 +	/** An array of pointer descriptors representing the subdomains of the DSN name. */
   1.153 +	RArray<TPtrC> iRep;
   1.154 +	/** A heap descriptor representing the full domain name. */
   1.155 +	HBufC* iName;
   1.156 +	};
   1.157 +
   1.158 +//rfc822 email address has the form localpart@domain
   1.159 +
   1.160 +class CX509RFC822NameSubtree : public CX509DomainName
   1.161 +/** A full or partial RFC 822 email address.
   1.162 +* 
   1.163 +* The address may not contain the local host name as this is optional.
   1.164 +* 
   1.165 +* The object is initialised with 8-bit encoded binary data, which is parsed 
   1.166 +* into a series of sub domains and an optional local host. 
   1.167 +*
   1.168 +* @publishedAll
   1.169 +* @released */
   1.170 +	{
   1.171 +public:
   1.172 +	/** Creates an RFC 822 email address object from the specified buffer containing 
   1.173 +	* the binary coded representation.
   1.174 +	* 
   1.175 +	* The data is parsed into a series of sub domains and an optional local host.
   1.176 +	* 
   1.177 +	* @param aBinaryData	The encoded binary representation.
   1.178 +	* @return				The new RFC 822 email address object. */
   1.179 +	IMPORT_C static CX509RFC822NameSubtree* NewL(const TDesC8& aBinaryData);
   1.180 +	
   1.181 +	/** Creates an RFC 822 email address object from the specified buffer containing 
   1.182 +	* the binary coded representation, and puts a pointer to it onto the cleanup stack.
   1.183 +	* The data is parsed into a series of sub domains and an optional local host.
   1.184 +	* 
   1.185 +	* @param aBinaryData	The encoded binary representation.
   1.186 +	* @return				The new RFC 822 email address object. */
   1.187 +	IMPORT_C static CX509RFC822NameSubtree* NewLC(const TDesC8& aBinaryData);
   1.188 +	
   1.189 +	/** Gets a reference to the array of pointer descriptors representing the subdomains 
   1.190 +	* of the RFC 822 email address.
   1.191 +	* 
   1.192 +	* @return	The array of pointer descriptors. */
   1.193 +	IMPORT_C const RArray<TPtrC>& Rep() const;
   1.194 +
   1.195 +protected:
   1.196 +	/** Second-phase constructor.
   1.197 +	* 
   1.198 +	* @param aBinaryData	The encoded binary representation. */
   1.199 +	virtual void ConstructL(const TDesC8& aBinaryData);
   1.200 +	
   1.201 +	/** Adds a local host.
   1.202 +	* 
   1.203 +	* @param aPos	The position from which to start decoding.
   1.204 +	* @return		ETrue, if the host has been found and added; EFalse, otherwise. 
   1.205 +	* @internalAll
   1.206 +	*/
   1.207 +	TBool AddLocalHostL(TInt& aPos);
   1.208 +	
   1.209 +	/** Tests whether the character is valid.
   1.210 +	* 
   1.211 +	* @param aChar	The character to be tested.
   1.212 +	* @return		ETrue, if the character is valid; EFalse, otherwise. 
   1.213 +	* @internalAll
   1.214 +	*/
   1.215 +	TBool IsValidChar(const TChar& aChar) const;
   1.216 +	};
   1.217 +
   1.218 +class CX509RFC822Name : public CX509RFC822NameSubtree
   1.219 +/** A full RFC 822 email address.
   1.220 +* 
   1.221 +* Exactly as subtree, but requires local host and full domain name. 
   1.222 +*
   1.223 +* @publishedAll
   1.224 +* @released */
   1.225 +	{
   1.226 +public:
   1.227 +	/** Creates a full RFC 822 email address object from the specified buffer containing 
   1.228 +	* the binary coded representation.
   1.229 +	* 
   1.230 +	* The data is parsed into a series of sub domains.
   1.231 +	* 
   1.232 +	* The data must represent a full RFC 822 email address, otherwise this function leaves.
   1.233 +	* 
   1.234 +	* @param aBinaryData	The encoded binary representation.
   1.235 +	* @return				The new full RFC 822 email address object. */
   1.236 +	IMPORT_C static CX509RFC822Name* NewL(const TDesC8& aBinaryData);
   1.237 +	
   1.238 +	/** Creates a full RFC 822 email address object from the specified buffer containing 
   1.239 +	* the binary coded representation, and puts a pointer to it onto the cleanup stack.
   1.240 +	* 
   1.241 +	* The data is parsed into a series of sub domains.
   1.242 +	* 
   1.243 +	* The data must represent a full RFC 822 email address, otherwise this function leaves.
   1.244 +	* 
   1.245 +	* @param aBinaryData	The encoded binary representation.
   1.246 +	* @return				The new full RFC 822 email address object. */
   1.247 +	IMPORT_C static CX509RFC822Name* NewLC(const TDesC8& aBinaryData);
   1.248 +private:
   1.249 +	virtual void ConstructL(const TDesC8& aBinaryData);
   1.250 +	};
   1.251 +
   1.252 +class CX509DNSNameSubtree : public CX509DomainName
   1.253 +/** A Domain Name System (DNS) name subtree.
   1.254 +* 
   1.255 +* Initialised with 8-bit encoded binary data, which is parsed into a series 
   1.256 +* of sub domains.
   1.257 +* 
   1.258 +* Because it is a subtree it may start with a period. For example, '.symbian.com', 
   1.259 +* indicating that 'symbian.com' does not lie within the subtree. 
   1.260 +*
   1.261 +* @publishedAll
   1.262 +* @released */
   1.263 +	{
   1.264 +public:
   1.265 +	/** Creates a DNS name object from the specified buffer containing the binary coded 
   1.266 +	* representation.
   1.267 +	* 
   1.268 +	* The data is parsed into a series of sub domains.
   1.269 +	* 
   1.270 +	* @param aBinaryData	The encoded binary representation.
   1.271 +	* @return				The new DNS name object. */
   1.272 +	IMPORT_C static CX509DNSNameSubtree* NewL(const TDesC8& aBinaryData);
   1.273 +	
   1.274 +	/** Creates a DNS name object from the specified buffer containing the binary coded 
   1.275 +	* representation, and puts a pointer to it onto the cleanup stack.
   1.276 +	* 
   1.277 +	* The data is parsed into a series of sub domains.
   1.278 +	* 
   1.279 +	* @param aBinaryData	The encoded binary representation.
   1.280 +	* @return				The new DNS name object. */
   1.281 +	IMPORT_C static CX509DNSNameSubtree* NewLC(const TDesC8& aBinaryData);
   1.282 +
   1.283 +//	IMPORT_C static CX509DNSNameSubtree* NewL(const CX509DNSNameSubtree& aName);
   1.284 +//	IMPORT_C static CX509DNSNameSubtree* NewLC(const CX509DNSNameSubtree& aName);
   1.285 +	
   1.286 +	/** Gets a reference to the array of pointer descriptors representing the subdomains 
   1.287 +	* of the DSN name.
   1.288 +	* 
   1.289 +	* @return	The array of pointer descriptors. */
   1.290 +	IMPORT_C const RArray<TPtrC>& Rep() const;
   1.291 +	
   1.292 +private:
   1.293 +	void ConstructL(const CX509DNSNameSubtree& aName);
   1.294 +	void ConstructL(const TDesC8& aBinaryData);
   1.295 +	TBool IsValidString(const TDesC& aStr) const;
   1.296 +	};
   1.297 +
   1.298 +class CX509DNSName : public CX509DNSNameSubtree
   1.299 +/** A Domain Name System (DNS) name.
   1.300 +* 
   1.301 +* The name must begin with a valid sub domain and not a period. 
   1.302 +*
   1.303 +* @publishedAll
   1.304 +* @released */
   1.305 +	{
   1.306 +public:
   1.307 +	/** Creates a DNS name object from the specified buffer containing the binary coded 
   1.308 +	* representation.
   1.309 +	* 
   1.310 +	* @param aBinaryData	The encoded binary representation.
   1.311 +	* @return				The new DNS name object. */
   1.312 +	IMPORT_C static CX509DNSName* NewL(const TDesC8& aBinaryData);
   1.313 +	
   1.314 +	/** Creates a DNS name object from the specified buffer containing the binary coded 
   1.315 +	* representation, and puts a pointer to it onto the cleanup stack.
   1.316 +	* 
   1.317 +	* @param aBinaryData	The encoded binary representation.
   1.318 +	* @return				The new DSN name object. */
   1.319 +	IMPORT_C static CX509DNSName* NewLC(const TDesC8& aBinaryData);
   1.320 +	
   1.321 +	/** Creates a new DSN name object from an existing object.
   1.322 +	* 
   1.323 +	* This is equivalent to a copy constructor.
   1.324 +	* 
   1.325 +	* @param aName	The DSN name object to be copied.
   1.326 +	* @return		The DSN name object. */
   1.327 +	IMPORT_C static CX509DNSName* NewL(const CX509DNSName& aName);
   1.328 +	
   1.329 +	/** Creates a new DSN name object from an existing object, and puts a pointer to 
   1.330 +	* it onto the clean up stack.
   1.331 +	* 
   1.332 +	* This is equivalent to a copy constructor.
   1.333 +	* 
   1.334 +	* @param aName	The DNS name object to be copied.
   1.335 +	* @return		The new DSN name object. */
   1.336 +	IMPORT_C static CX509DNSName* NewLC(const CX509DNSName& aName);
   1.337 +	
   1.338 +	/** Constructs a new DSN name object from a name string.
   1.339 +	* 
   1.340 +	* @param aNameString	The name string.
   1.341 +	* @return				The new DSN name object. */
   1.342 +	IMPORT_C static CX509DNSName* NewL(const TDesC& aNameString);
   1.343 +	
   1.344 +	/** Creates a DSN name object from a name string, and puts a pointer to it onto 
   1.345 +	* the cleanup stack.
   1.346 +	* 
   1.347 +	* @param aNameString	The name string.
   1.348 +	* @return				The new DSN name object. */
   1.349 +	IMPORT_C static CX509DNSName* NewLC(const TDesC& aNameString);
   1.350 +private:
   1.351 +	void ConstructL(const TDesC8& aBinaryData);
   1.352 +	void ConstructL(const TDesC& aNameString);
   1.353 +	void ConstructL(const CX509DNSName& aName);
   1.354 +	void ParseNameL();
   1.355 +	};
   1.356 +
   1.357 +class CX509IPBasedURI : public CBase
   1.358 +/** A URI.
   1.359 +* 
   1.360 +* The class extracts a DNS name, i.e. the host part of the URI.
   1.361 +* 
   1.362 +* Note that it must be of 'ip-based' form (see RFC 1738 section 3.1) and contain 
   1.363 +* a domain name (not an IP address). 
   1.364 +*
   1.365 +* @publishedAll
   1.366 +* @released */
   1.367 +	{
   1.368 +public:
   1.369 +	/** Creates an IP based URI name object from the specified buffer containing the 
   1.370 +	* binary coded representation.
   1.371 +	* 
   1.372 +	* @param aBinaryData	The encoded binary representation.
   1.373 +	* @return				The new URI name object. */
   1.374 +	IMPORT_C static CX509IPBasedURI* NewL(const TDesC8& aBinaryData);
   1.375 +	
   1.376 +	/** Creates a URI name object from the specified buffer containing the binary coded 
   1.377 +	* representation, and puts a pointer to it onto the clean up stack.
   1.378 +	* 
   1.379 +	* @param aBinaryData	The encoded binary representation.
   1.380 +	* @return				The new URI name object. */
   1.381 +	IMPORT_C static CX509IPBasedURI* NewLC(const TDesC8& aBinaryData);
   1.382 +	
   1.383 +	/** Destructor.
   1.384 +	* 
   1.385 +	* Frees all resources owned by the object, prior to its destruction. */
   1.386 +	IMPORT_C ~CX509IPBasedURI();
   1.387 +	
   1.388 +	/** Gets the host part.
   1.389 +	* 
   1.390 +	* @return	The host part. */
   1.391 +	IMPORT_C const CX509DNSName& Host() const;
   1.392 +	
   1.393 +	/** Gets the whole name.
   1.394 +	* 
   1.395 +	* @return	A pointer descriptor representing the whole name. */
   1.396 +	IMPORT_C TPtrC Name() const;
   1.397 +	
   1.398 +	/** Default constructor.
   1.399 +	 * @internalAll
   1.400 +	 */
   1.401 +	CX509IPBasedURI();
   1.402 +private:
   1.403 +	void ConstructL(const TDesC8& aBinaryData);
   1.404 +	TPtrC ExtractHostNameL() const;
   1.405 +	CX509DNSName* iHost;
   1.406 +	HBufC* iName;
   1.407 +	};
   1.408 +
   1.409 +class CX509IPSubnetMask : public CBase
   1.410 +/** An IP subnet mask.
   1.411 +* 
   1.412 +* Input data is parsed into an 8-bit base address and an 8-bit mask. 
   1.413 +*
   1.414 +* @publishedAll
   1.415 +* @released */
   1.416 +	{
   1.417 +	friend class CX509IPAddress;
   1.418 +public:
   1.419 +	/** Creates an IP subnet mask object from the specified buffer containing the binary 
   1.420 +	* coded representation.
   1.421 +	* 
   1.422 +	* The data is parsed into an 8-bit base address and an 8-bit mask.
   1.423 +	* 
   1.424 +	* @param aBinaryData	The encoded binary representation.
   1.425 +	* @return				The new IP subnet mask object. */
   1.426 +	IMPORT_C static CX509IPSubnetMask* NewL(const TDesC8& aBinaryData);
   1.427 +	
   1.428 +	/** Creates an IP subnet mask object from the specified buffer containing the binary 
   1.429 +	* coded representation, and puts a pointer to it onto the cleanup stack.
   1.430 +	* 
   1.431 +	* The data is parsed into an 8-bit base address and an 8-bit mask.
   1.432 +	* 
   1.433 +	* @param aBinaryData	The encoded binary representation.
   1.434 +	* @return				The new IP subnet mask object. */
   1.435 +	IMPORT_C static CX509IPSubnetMask* NewLC(const TDesC8& aBinaryData);
   1.436 +	
   1.437 +	/** Destructor.
   1.438 +	* 
   1.439 +	* Frees all resources owned by the object, prior to its destruction. */
   1.440 +	IMPORT_C ~CX509IPSubnetMask();
   1.441 +	
   1.442 +	/** Gets the base IP address.
   1.443 +	* 
   1.444 +	* @return	A pointer descriptor representing the base IP address. */
   1.445 +	IMPORT_C TPtrC8 BaseAddress() const;
   1.446 +	
   1.447 +	/** Gets the subnet mask.
   1.448 +	* 
   1.449 +	* @return	A pointer descriptor representing the subnet mask. */
   1.450 +	IMPORT_C TPtrC8 Mask() const;
   1.451 +	
   1.452 +	/** Constructor. 
   1.453 +	 * @internalAll
   1.454 +	 */
   1.455 +	CX509IPSubnetMask();
   1.456 +private:
   1.457 +	void ConstructL(const TDesC8& aBinaryData);
   1.458 +	HBufC8* iName;
   1.459 +	};
   1.460 +
   1.461 +class CX509IPAddress : public CBase
   1.462 +/** A single IP address. 
   1.463 +*
   1.464 +* @publishedAll
   1.465 +* @released */
   1.466 +	{
   1.467 +public:
   1.468 +	/** Creates a single IP address object from the specified buffer containing the 
   1.469 +	* binary coded representation.
   1.470 +	* 
   1.471 +	* @param aBinaryData	The encoded binary representation.
   1.472 +	* @return				The new single IP addres. */
   1.473 +	IMPORT_C static CX509IPAddress* NewL(const TDesC8& aBinaryData);
   1.474 +	
   1.475 +	/** Creates a single IP address object from the specified buffer containing the 
   1.476 +	* binary coded representation, and puts a pointer to it onto the cleanup stack.
   1.477 +	* 
   1.478 +	* @param aBinaryData	The encoded binary representation.
   1.479 +	* @return				The new single IP addres object. */
   1.480 +	IMPORT_C static CX509IPAddress* NewLC(const TDesC8& aBinaryData);
   1.481 +	
   1.482 +	/** Tests whether the IP address lies within the specified subnet address.
   1.483 +	* 
   1.484 +	* @param aName	The subnet mask name.
   1.485 +	* @return		ETrue, if the IP address lies within the specified subnet address; 
   1.486 +	* EFalse, otherwise. */
   1.487 +	IMPORT_C TBool IsWithinSubtree(const CX509IPSubnetMask& aName) const;
   1.488 +	
   1.489 +	/** Destructor.
   1.490 +	* 
   1.491 +	* Frees all resources owned by the object, prior to its destruction. */
   1.492 +	IMPORT_C ~CX509IPAddress();
   1.493 +	
   1.494 +	/** Gets the IP address.
   1.495 +	* 
   1.496 +	* @return	A pointer descriptor representing the single IP address. */
   1.497 +	IMPORT_C TPtrC8 Address() const;
   1.498 +	
   1.499 +	/** Constructor. 
   1.500 +	 * @internalAll
   1.501 +	 */
   1.502 +	CX509IPAddress();
   1.503 +private:
   1.504 +	void ConstructL(const TDesC8& aBinaryData);
   1.505 +	HBufC8* iName;//4 octets for v4, 16 for v6
   1.506 +	};
   1.507 +
   1.508 +//general name...
   1.509 +
   1.510 +class CX509GeneralName : public CBase
   1.511 +/** Defines a general name.
   1.512 +* 
   1.513 +* The class contains a tag and a name whose form depends on the value of that tag.
   1.514 +* 
   1.515 +* When a General Name is included as part of a Name Constraints Extension, the 
   1.516 +* values need not be complete names but may be simply subtrees.
   1.517 +* 
   1.518 +* For example, 'symbian.com' instead of john.doe@symbian.com'. Both names are 
   1.519 +* valid subtrees but only the second is a valid RFC822 name. 
   1.520 +*
   1.521 +* @publishedAll
   1.522 +* @released */
   1.523 +	{
   1.524 +public:
   1.525 +	/** Creates a new general name object from the specified buffer containing the 
   1.526 +	* binary coded representation.	
   1.527 +	* 
   1.528 +	* @param aBinaryData	The encoded binary representation.
   1.529 +	* @return				The new general name object. */
   1.530 +	IMPORT_C static CX509GeneralName* NewL(const TDesC8& aBinaryData);
   1.531 +	
   1.532 +	/** Creates a new general name object from the specified buffer containing the 
   1.533 +	* binary coded representation, and puts a pointer to it onto the cleanup stack.
   1.534 +	* 
   1.535 +	* Initialises the object from its encoded binary form into an internal representation.
   1.536 +	* 
   1.537 +	* @param aBinaryData	The encoded binary representation.
   1.538 +	* @return				The new general name object. */
   1.539 +	IMPORT_C static CX509GeneralName* NewLC(const TDesC8& aBinaryData);
   1.540 +	
   1.541 +	/** Creates a new general name object from the specified buffer containing the 
   1.542 +	* binary coded representation,starting at the specified offset.
   1.543 +	* 
   1.544 +	* @param aBinaryData	The encoded binary representation.
   1.545 +	* @param aPos			The offset position from which to start decoding.
   1.546 +	* @return				The new general name object. */
   1.547 +	IMPORT_C static CX509GeneralName* NewL(const TDesC8& aBinaryData, TInt& aPos);
   1.548 +	
   1.549 +	/** Creates a new general name object from the specified buffer containing the 
   1.550 +	* binary coded representation, starting at the specified offset, and puts a 
   1.551 +	* pointer to it onto the cleanup stack.
   1.552 +	* 
   1.553 +	* Initialises the object from its encoded binary form into an internal representation.
   1.554 +	* 
   1.555 +	* @param aBinaryData	The encoded binary representation.
   1.556 +	* @param aPos			The offset position from which to start decoding.
   1.557 +	* @return				The new general name object. */
   1.558 +	IMPORT_C static CX509GeneralName* NewLC(const TDesC8& aBinaryData, TInt& aPos);
   1.559 +
   1.560 +	/** Creates a new general name object from an existing object.
   1.561 +	* 
   1.562 +	* This is equivalent to a copy constructor.
   1.563 +	* 
   1.564 +	* @param aName			The general name object to be copied.
   1.565 +	* @return				The new general name object. */
   1.566 +	IMPORT_C static CX509GeneralName* NewL(const CX509GeneralName& aName);
   1.567 +	
   1.568 +	/** Creates a new general name object from an existing object, and puts a pointer 
   1.569 +	* to it onto the cleanup stack.
   1.570 +	* 
   1.571 +	* This is equivalent to a copy constructor.
   1.572 +	* 
   1.573 +	* @param aName			The general name object to be copied.
   1.574 +	* @return				The new general name object. */
   1.575 +	IMPORT_C static CX509GeneralName* NewLC(const CX509GeneralName& aName);
   1.576 +
   1.577 +	/** Gets the type tag.
   1.578 +	* 
   1.579 +	* @return	The type tag. */
   1.580 +	IMPORT_C TGNType Tag() const;
   1.581 +	
   1.582 +	/** Gets the name.
   1.583 +	* 
   1.584 +	* @return	A pointer descriptor representing the name. */
   1.585 +	IMPORT_C TPtrC8 Data() const;
   1.586 +	
   1.587 +	/** Destructor.
   1.588 +	* 
   1.589 +	* Frees all resources owned by the object, prior to its destruction. */
   1.590 +	IMPORT_C ~CX509GeneralName(); 
   1.591 +	
   1.592 +	/** Dummy Function which always returns EFalse.
   1.593 +	* @param aName	The general name object to be copied.
   1.594 +	* @return		EFalse.
   1.595 +	*/
   1.596 +	IMPORT_C TBool ExactMatch(const CX509GeneralName& aName) const;
   1.597 +private:
   1.598 +	CX509GeneralName();
   1.599 +	CX509GeneralName(TGNType aType);
   1.600 +	void ConstructL();
   1.601 +	void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
   1.602 +	void ConstructL(const TDesC8& aData);
   1.603 +	TGNType iTag;
   1.604 +	HBufC8* iData;
   1.605 +	};
   1.606 +
   1.607 +#endif