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 __MCERTINFO_H__
28 #define __MCERTINFO_H__
30 #include <ct/rmpointerarray.h>
32 // Forward declarations
34 class CCertAttributeFilter;
35 class TCTTokenObjectHandle;
42 * Defines the interface for a read-only certificate store.
44 * This documentation describes the security policy that must be enforced by
45 * implementations of the interface.
51 * Listing Certificates
55 * Get a list of all certificates that satisfy the supplied filter.
57 * This is an async function; all errors are reported by completing aStatus
58 * with the error value, and it can be cancelled with CancelList().
60 * @param aCerts An array into which the returned certificates are placed.
61 * @param aFilter A filter to select which certificates should be included.
62 * @param aStatus A request status that will be completed when the operation completes.
64 virtual void List(RMPointerArray<CCTCertInfo>& aCerts, const CCertAttributeFilter& aFilter,
65 TRequestStatus& aStatus) = 0;
67 /** Cancels an ongoing List() operation. */
68 virtual void CancelList() = 0;
71 * Getting a certificate given a handle.
75 * Get a certificate given its handle.
77 * @param aCertInfo The returned certificate.
78 * @param aHandle The handle of the certificate to return.
79 * @param aStatus The request status object; contains the result of the
80 * GetCert() request when complete. Set to KErrCancel if any outstanding
81 * request is cancelled.
83 virtual void GetCert(CCTCertInfo*& aCertInfo, const TCTTokenObjectHandle& aHandle,
84 TRequestStatus& aStatus) = 0;
86 /** Cancel an ongoing GetCert() operation. */
87 virtual void CancelGetCert() = 0;
90 * Querying the applications of a certificate.
94 * Get the list of the applications associcated with certificate.
96 * Applications are represented by UIDs. Examples would be Software Install,
97 * TLS, WTLS, WMLScript, SignText, etc..
99 * @param aCertInfo The certificate to return applications for.
100 * @param aAplications An array to save the applications in.
101 * @param aStatus The request status object; contains the result of the
102 * Applications() request when complete. Set to KErrCancel if any
103 * outstanding request is cancelled.
105 virtual void Applications(const CCTCertInfo& aCertInfo, RArray<TUid>& aAplications,
106 TRequestStatus& aStatus) = 0;
108 /** Cancels an ongoing Applications() operation. */
109 virtual void CancelApplications() = 0;
112 * Tests if a certificate is applicable to a particular application.
114 * @param aCertInfo The certificate in question.
115 * @param aApplication The application.
116 * @param aIsApplicable Set to ETrue or EFalse by the function to return the result.
117 * @param aStatus The request status object; contains the result of the
118 * IsApplicable() request when complete. Set to KErrCancel if any
119 * outstanding request is cancelled.
121 virtual void IsApplicable(const CCTCertInfo& aCertInfo, TUid aApplication,
122 TBool& aIsApplicable, TRequestStatus& aStatus) = 0;
124 /** Cancels an ongoing IsApplicable() operation. */
125 virtual void CancelIsApplicable() = 0;
132 * Tests whether a certificate is trusted.
134 * Trust is only meaningful for CA certificates where it means that the
135 * certificate can be used as a trust root for the purposes of certificate
138 * @param aCertInfo The certificate we are interested in.
139 * @param aTrusted Used to return the trust status.
140 * @param aStatus The request status object; contains the result of the
141 * Trusted() request when complete. Set to KErrCancel if any outstanding
142 * request is cancelled.
144 virtual void Trusted(const CCTCertInfo& aCertInfo, TBool& aTrusted,
145 TRequestStatus& aStatus) = 0;
147 /** Cancels an ongoing Trusted() operation. */
148 virtual void CancelTrusted() = 0;
151 * Retrieving the actual certificate
155 * Retrieves the actual data of the certificate.
157 * @param aCertInfo The certificate to retrieve.
158 * @param aEncodedCert A buffer to put the certificate in. It must be big
159 * enough; the size is stored in aCertInfo.
160 * @param aStatus The request status object; contains the result of the
161 * Retrieve()request when complete. Set to KErrCancel if any outstanding
162 * request is cancelled.
164 * @capability ReadUserData This requires the ReadUserData capability when
165 * applied to user certificates, as these may contain sensitive user data.
166 * @leave KErrPermissionDenied If called for a user certificate when the
167 * caller doesn't have the ReadUserData capability.
169 virtual void Retrieve(const CCTCertInfo& aCertInfo, TDes8& aEncodedCert,
170 TRequestStatus& aStatus) = 0;
172 /** Cancels an ongoing Retrieve() operation. */
173 virtual void CancelRetrieve() = 0;