|
||
class CUnifiedCertStore : public CActive, public MCertStore;
The unified certificate store.
This class provides a certificate store whose contents are the sum of the contents of all certificate store implementations on the device. It is intended as the single point of access for clients wishing to use certificate stores.
Since this class is intended for widespread use, capability checks relating to certificate access are documented here even though the checks are actually made in the individual cert store implementations.
MCertStore
- No description.
CBase
-
Base class for all classes to be instantiated on the heap.
CActive
-
The core class of the active object abstraction.
CUnifiedCertStore
- The unified certificate store.
Defined in CUnifiedCertStore
:
Applications(const CCTCertInfo &,RArray< TUid > &,TRequestStatus &)
Gets the list of applications . Applications are represented by UIDs .CancelApplications()
Cancels an ongoing CUnifiedCertStore::Applications(const CCTCertInfo &,RArra...CancelGetCert()
Cancel an ongoing CUnifiedCertStore::GetCert(CCTCertInfo *&,const TCTTokenOb...CancelInitialize()
Cancels an ongoing CUnifiedCertStore::Initialize(TRequestStatus &) operation...CancelIsApplicable()
Cancels an ongoing CUnifiedCertStore::IsApplicable(const CCTCertInfo &,TUid,...CancelList()
Cancels an ongoing CUnifiedCertStore::List(RMPointerArray< CCTCertInfo > &...CancelRemove()
Cancels an ongoing CUnifiedCertStore::Remove(const CCTCertInfo &,TRequestSta...CancelRetrieve()
Cancels an ongoing CUnifiedCertStore::Retrieve(const CCTCertInfo &,TDes8 &am...CancelSetApplicability()
Cancels an ongoing CUnifiedCertStore::SetApplicability(const CCTCertInfo &,c...CancelSetTrust()
Cancels an ongoing CUnifiedCertStore::SetTrust(const CCTCertInfo &,TBool,TRe...CancelTrusted()
Cancels an ongoing CUnifiedCertStore::Trusted(const CCTCertInfo &,TBool &...CertStore(TInt)
Gets a particular certificate store.CertStoreCount()const
Gets the number of certificate stores.DoCancel()
Implements cancellation of an outstanding request.GetCert(CCTCertInfo *&,const TCTTokenObjectHandle &,TRequestStatus &)
Get a certificate given its handle.Initialize(TRequestStatus &)
Initializes the manager.IsApplicable(const CCTCertInfo &,TUid,TBool &,TRequestStatus &)
Tests if a certificate is applicable to a particular application.List(RMPointerArray< CCTCertInfo > &,const CCertAttributeFilter &,RPointerArray< const TDesC8 >,TRequestStatus &)
Lists all certificates that have a particular issuer.List(RMPointerArray< CCTCertInfo > &,const CCertAttributeFilter &,TRequestStatus &)
Lists all certificates that satisfy the supplied filter.List(RMPointerArray< CCTCertInfo > &,const CCertAttributeFilter &,const TDesC8 &,TRequestStatus &)
Lists all certificates that have a particular subject DN.NewL(RFs &,TBool)
Creates a new CUnifiedCertStoreNewL(RFs &,TBool,RArray< TInt > &)
Creates a new CUnifiedCertStore with the sequence filter, so that multiple certs...NewLC(RFs &,TBool)
Creates a new CUnifiedCertStore and pushes it on the cleanup stack.NewLC(RFs &,TBool,RArray< TInt > &)
Creates a new CUnifiedCertStore with the sequence filter, so that multiple certs...ReadOnlyCertStore(TInt)
Gets a particular read-only certificate store.ReadOnlyCertStoreCount()const
Gets the number of read-only certificate stores.Remove(const CCTCertInfo &,TRequestStatus &)
Removes a certificate.Retrieve(const CCTCertInfo &,CCertificate *&,TRequestStatus &)
Retrieves a certificate as a parsed object.Retrieve(const CCTCertInfo &,TDes8 &,TRequestStatus &)
Retrieves the actual data of the certificate.RunError(TInt)
RunL()
Handles an active object's request completion event.SetApplicability(const CCTCertInfo &,const RArray< TUid > &,TRequestStatus &)
Replaces the current applicability settings with the settings in the supplied ar...SetTrust(const CCTCertInfo &,TBool,TRequestStatus &)
Changes the trust settings.Trusted(const CCTCertInfo &,TBool &,TRequestStatus &)
Tests whether a certificate is trusted.WritableCertStore(TInt)
Gets a particular writeable certificate store.WritableCertStoreCount()const
Gets the number of writeable certificate stores.~CUnifiedCertStore()
The destructor destroys all the resources owned by this object.Inherited from CActive
:
CActive(TInt)
Constructs the active object with the specified priority.Cancel()
Cancels the wait for completion of an outstanding request.Deque()
Removes the active object from the active scheduler's list of active objects.EPriorityHigh
A priority higher than EPriorityUserInput.EPriorityIdle
A low priority, useful for active objects representing background processing.EPriorityLow
A priority higher than EPriorityIdle but lower than EPriorityStandard.EPriorityStandard
Most active objects will have this priority.EPriorityUserInput
A priority higher than EPriorityStandard; useful for active objects handling use...Extension_(TUint,TAny *&,TAny *)
Extension function IsActive()const
Determines whether the active object has a request outstanding.IsAdded()const
Determines whether the active object has been added to the active scheduler's li...Priority()const
Gets the priority of the active object.SetActive()
Indicates that the active object has issued a request and that it is now outstan...SetPriority(TInt)
Sets the priority of the active object.TPriority
Defines standard priorities for active objects. iStatus
The request status associated with an asynchronous request.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...IMPORT_C static CUnifiedCertStore* NewL(RFs &aFs, TBool aOpenForWrite);
Creates a new CUnifiedCertStore
|
|
IMPORT_C static CUnifiedCertStore* NewLC(RFs &aFs, TBool aOpenForWrite);
Creates a new CUnifiedCertStore and pushes it on the cleanup stack.
|
|
IMPORT_C static CUnifiedCertStore* NewL(RFs &aFs, TBool aOpenForWrite, RArray< TInt > &aOrderFilter);
Creates a new CUnifiedCertStore with the sequence filter, so that multiple certstores that are managed by it will be filtered and ordered.
|
|
IMPORT_C static CUnifiedCertStore* NewLC(RFs &aFs, TBool aOpenForWrite, RArray< TInt > &aOrderFilter);
Creates a new CUnifiedCertStore with the sequence filter, so that multiple certstores that are managed by it will be filtered and ordered, and it is pushed on the cleanup stack.
|
|
IMPORT_C ~CUnifiedCertStore();
The destructor destroys all the resources owned by this object.
IMPORT_C void Initialize(TRequestStatus &aStatus);
Initializes the manager.
It must be called after the manager has been constructed and before any call to the manager functions.
This is an asynchronous request.
|
IMPORT_C void CancelInitialize();
Cancels an ongoing CUnifiedCertStore::Initialize(TRequestStatus &)
operation.
The operation completes with KErrCancel.
virtual void List(RMPointerArray< CCTCertInfo > &aCertInfos, const CCertAttributeFilter &aFilter, TRequestStatus &aStatus);
Lists all certificates that satisfy the supplied filter.
|
virtual void CancelList();
Cancels an ongoing CUnifiedCertStore::List(RMPointerArray< CCTCertInfo > &,const CCertAttributeFilter &,TRequestStatus &)
operation.
virtual void GetCert(CCTCertInfo *&aCertInfo, const TCTTokenObjectHandle &aHandle, TRequestStatus &aStatus);
Get a certificate given its handle.
|
virtual void CancelGetCert();
Cancel an ongoing CUnifiedCertStore::GetCert(CCTCertInfo *&,const TCTTokenObjectHandle &,TRequestStatus &)
operation.
virtual void Applications(const CCTCertInfo &aCertInfo, RArray< TUid > &aApplications, TRequestStatus &aStatus);
Gets the list of applications . Applications are represented by UIDs .
|
virtual void CancelApplications();
Cancels an ongoing CUnifiedCertStore::Applications(const CCTCertInfo &,RArray< TUid > &,TRequestStatus &)
operation.
virtual void IsApplicable(const CCTCertInfo &aCertInfo, TUid aApplication, TBool &aIsApplicable, TRequestStatus &aStatus);
Tests if a certificate is applicable to a particular application.
|
virtual void CancelIsApplicable();
Cancels an ongoing CUnifiedCertStore::IsApplicable(const CCTCertInfo &,TUid,TBool &,TRequestStatus &)
operation.
virtual void Trusted(const CCTCertInfo &aCertInfo, TBool &aTrusted, TRequestStatus &aStatus);
Tests whether a certificate is trusted.
Trust is only meaningful for CA certificates where it means that the certificate can be used as a trust root for the purposes of certificate validation.
|
virtual void CancelTrusted();
Cancels an ongoing CUnifiedCertStore::Trusted(const CCTCertInfo &,TBool &,TRequestStatus &)
operation.
Capability: | ReadUserData | This requires the ReadUserData capability when applied to user certificates, as these may contain sensitive user data. |
virtual void Retrieve(const CCTCertInfo &aCertInfo, TDes8 &aEncodedCert, TRequestStatus &aStatus);
Retrieves the actual data of the certificate.
|
|
virtual void CancelRetrieve();
Cancels an ongoing CUnifiedCertStore::Retrieve(const CCTCertInfo &,TDes8 &,TRequestStatus &)
operation.
Capability: | WriteDeviceData | This requires the WriteDeviceData capability when applied to CA certificates. |
Capability: | WriteUserData | This requires the WriteUserData capability when applied to user certificates. |
IMPORT_C void Remove(const CCTCertInfo &aCertInfo, TRequestStatus &aStatus);
Removes a certificate.
|
|
IMPORT_C void CancelRemove();
Cancels an ongoing CUnifiedCertStore::Remove(const CCTCertInfo &,TRequestStatus &)
operation.
The operation completes with KErrCancel.
Capability: | WriteDeviceData | This requires the WriteDeviceData capability. |
IMPORT_C void SetApplicability(const CCTCertInfo &aCertInfo, const RArray< TUid > &aApplications, TRequestStatus &aStatus);
Replaces the current applicability settings with the settings in the supplied array.
This should only be called for CA certificates - it has no meaning for user certificates.
|
|
IMPORT_C void CancelSetApplicability();
Cancels an ongoing CUnifiedCertStore::SetApplicability(const CCTCertInfo &,const RArray< TUid > &,TRequestStatus &)
operation.
The operation completes with KErrCancel.
Capability: | WriteDeviceData | This requires the WriteDeviceData capability. |
IMPORT_C void SetTrust(const CCTCertInfo &aCertInfo, TBool aTrusted, TRequestStatus &aStatus);
Changes the trust settings.
A CA certificate is trusted if the user is willing to use it for authenticating servers. It has no meaning with other types of certificates.
|
|
IMPORT_C void CancelSetTrust();
Cancels an ongoing CUnifiedCertStore::SetTrust(const CCTCertInfo &,TBool,TRequestStatus &)
operation.
The operation completes with KErrCancel.
IMPORT_C void List(RMPointerArray< CCTCertInfo > &aCertInfos, const CCertAttributeFilter &aFilter, const TDesC8 &aIssuer,
TRequestStatus &aStatus);
Lists all certificates that have a particular subject DN.
|
List(RMPointerArray< CCTCertInfo > &,const CCertAttributeFilter &,RPointerArray< const TDesC8 >,TRequestStatus &)
IMPORT_C void List(RMPointerArray< CCTCertInfo > &aCertInfos, const CCertAttributeFilter &aFilter, RPointerArray< const TDesC8
> aIssuers, TRequestStatus &aStatus);
Lists all certificates that have a particular issuer.
|
Capability: | ReadUserData | This requires the ReadUserData capability when applied to user certificates, as these may contain sensitive user data. |
IMPORT_C void Retrieve(const CCTCertInfo &aCertInfo, CCertificate *&aCert, TRequestStatus &aStatus);
Retrieves a certificate as a parsed object.
This will only work for certificates that have a CCertificate-derived representation, in other words X509 and WTLS certificates. If called for a URL certificate, KErrNotSupported is returned.
|
|
IMPORT_C TInt CertStoreCount() const;
Gets the number of certificate stores.
|
IMPORT_C MCTCertStore& CertStore(TInt aIndex);
Gets a particular certificate store.
|
|
IMPORT_C TInt WritableCertStoreCount() const;
Gets the number of writeable certificate stores.
|
IMPORT_C MCTWritableCertStore& WritableCertStore(TInt aIndex);
Gets a particular writeable certificate store.
|
|
IMPORT_C TInt ReadOnlyCertStoreCount() const;
Gets the number of read-only certificate stores.
|
IMPORT_C MCTCertStore& ReadOnlyCertStore(TInt aIndex);
Gets a particular read-only certificate store.
|
|
private: virtual void DoCancel();
Implements cancellation of an outstanding request.
This function is called as part of the active object's CActive::Cancel()
.
It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.
CUnifiedCertStore::DoCancel()
must not wait for event completion; this is handled by CActive::Cancel()
.
CActive::Cancel()
Cancels the wait for completion of an outstanding request.private: virtual void RunL();
Handles an active object's request completion event.
A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.
The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.
Before calling this active object's CUnifiedCertStore::RunL()
function, the active scheduler has:
1. decided that this is the highest priority active object with a completed request
2. marked this active object's request as complete (i.e. the request is no longer outstanding)
CUnifiedCertStore::RunL()
runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls CUnifiedCertStore::RunError(TInt)
to handle the leave.
Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active
object's CUnifiedCertStore::RunL()
or CUnifiedCertStore::RunError(TInt)
functions.
CActiveScheduler::Start()
Starts a new wait loop under the control of the current active scheduler.CActiveScheduler::Error(TInt)const
Handles the result of a leave occurring in an active object’s RunL() function.CActiveScheduler::WaitForAnyRequest()
Wait for an asynchronous request to complete.