Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
27 #ifndef __CCERTATTRIBUTEFILTER_H__
28 #define __CCERTATTRIBUTEFILTER_H__
32 #include <securitydefs.h>
33 #include <cctcertinfo.h>
37 * A filter for specifying which certificates are required.
39 * On construction it will accept everything.
40 * The Set... functions can then be used to restrict it.
42 class CCertAttributeFilter : public CBase
46 * Returns a default filter. This filter accepts any
47 * certificate. Call the Set... functions to restrict what it accepts.
49 * @return A pointer to a new CCertAttributeFilter object.
51 IMPORT_C static CCertAttributeFilter* NewL();
53 * Returns a default filter. This filter accepts any certificate.
54 * It leaves the filter on the cleanup stack.
56 * @return A pointer to a new CCertAttributeFilter object.
58 IMPORT_C static CCertAttributeFilter* NewLC();
61 * Read a certificate attribute filter from a stream.
63 IMPORT_C static CCertAttributeFilter* NewL(RReadStream& aStream);
65 * Write a certificate attribute filter to a stream.
67 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
72 * Sets the label of the cert that the filter will accept.
74 * @param aLabel The new label
76 IMPORT_C void SetLabel(const TCertLabel& aLabel);
79 * Sets the UID of an application which the certificate must support
81 * @param aUid The new UID
83 IMPORT_C void SetUid(TUid aUid);
86 * Sets the format of the returned certificates
88 * @param aFormat The required format
90 IMPORT_C void SetFormat(TCertificateFormat aFormat);
93 * Sets the owner type of the returned certificates
95 * @param aOwnerType The owner type.
97 IMPORT_C void SetOwnerType(TCertificateOwnerType aOwnerType);
100 * Sets the usage that returned certs must be used for.
102 * Note that the usage is supplied using X509 scheme -
103 * keystore interfaces use the PKCS#15 scheme!
105 * @param aKeyUsage The key usage
107 IMPORT_C void SetKeyUsage(TKeyUsageX509 aKeyUsage);
110 * Sets the subject key ID that returned certificates must have.
112 * @param aSubjectKeyId The subject key ID
114 IMPORT_C void SetSubjectKeyId(const TKeyIdentifier& aSubjectKeyId);
117 * Sets the issuer key ID that returned certificates must have.
119 * @param aIssuerKeyId The issuer key ID
121 IMPORT_C void SetIssuerKeyId(const TKeyIdentifier& aIssuerKeyId);
124 CCertAttributeFilter();
125 void InternalizeL(RReadStream& aStream);
128 /** The filter data. Each data item is accompanied by a
129 '..IsSet' boolean which indicates if the item should be used.
130 Unset values (whose ..IsSet variable is EFalse) should be ignored.
133 /** The label that returned certificates must have. */
135 /** Indicates that iLabel should be used. */
137 /** The application UID that all returned certificates must have. */
139 /** Indicates that iUid should be used. */
141 /** The format of certificates that should be included. */
142 TCertificateFormat iFormat;
143 /** Indicates that iFormat should be used. */
145 /** The owner type of returned certificates. */
146 TCertificateOwnerType iOwnerType;
147 /** Indicates that iOwnerType should be used. */
148 TBool iOwnerTypeIsSet;
149 /** The usage of keys that should be returned. */
150 TKeyUsageX509 iKeyUsage;
151 /** The subject key that returned certs should have. */
152 TKeyIdentifier iSubjectKeyId;
153 /** Indicates that iSubjectKeyId should be used. */
154 TBool iSubjectKeyIdIsSet;
155 /** The issuer key that returned certs should have. */
156 TKeyIdentifier iIssuerKeyId;
157 /** Indicates that iIssuerKeyId should be used. */
158 TBool iIssuerKeyIdIsSet;