CUnifiedCertStore Class Reference

#include <unifiedcertstore.h>

class CUnifiedCertStore : public CActive

Inherits from

  • CUnifiedCertStore
    Public Member Functions
    ~CUnifiedCertStore()
    virtual voidApplications(const CCTCertInfo &, RArray< TUid > &, TRequestStatus &)
    virtual voidCancelApplications()
    virtual voidCancelGetCert()
    IMPORT_C voidCancelInitialize()
    virtual voidCancelIsApplicable()
    virtual voidCancelList()
    IMPORT_C voidCancelRemove()
    virtual voidCancelRetrieve()
    IMPORT_C voidCancelSetApplicability()
    IMPORT_C voidCancelSetTrust()
    virtual voidCancelTrusted()
    IMPORT_C MCTCertStore &CertStore(TInt)
    IMPORT_C TIntCertStoreCount()
    virtual voidGetCert(CCTCertInfo *&, const TCTTokenObjectHandle &, TRequestStatus &)
    IMPORT_C voidInitialize(TRequestStatus &)
    virtual voidIsApplicable(const CCTCertInfo &, TUid, TBool &, TRequestStatus &)
    virtual voidList(RMPointerArray< CCTCertInfo > &, const CCertAttributeFilter &, TRequestStatus &)
    IMPORT_C voidList(RMPointerArray< CCTCertInfo > &, const CCertAttributeFilter &, const TDesC8 &, TRequestStatus &)
    IMPORT_C voidList(RMPointerArray< CCTCertInfo > &, const CCertAttributeFilter &, RPointerArray< const TDesC8 >, TRequestStatus &)
    IMPORT_C CUnifiedCertStore *NewL(RFs &, TBool)
    IMPORT_C CUnifiedCertStore *NewL(RFs &, TBool, RArray< TInt > &)
    IMPORT_C CUnifiedCertStore *NewLC(RFs &, TBool)
    IMPORT_C CUnifiedCertStore *NewLC(RFs &, TBool, RArray< TInt > &)
    IMPORT_C MCTCertStore &ReadOnlyCertStore(TInt)
    IMPORT_C TIntReadOnlyCertStoreCount()
    IMPORT_C voidRemove(const CCTCertInfo &, TRequestStatus &)
    virtual voidRetrieve(const CCTCertInfo &, TDes8 &, TRequestStatus &)
    IMPORT_C voidRetrieve(const CCTCertInfo &, CCertificate *&, TRequestStatus &)
    IMPORT_C voidSetApplicability(const CCTCertInfo &, const RArray< TUid > &, TRequestStatus &)
    IMPORT_C voidSetTrust(const CCTCertInfo &, TBool, TRequestStatus &)
    virtual voidTrusted(const CCTCertInfo &, TBool &, TRequestStatus &)
    IMPORT_C MCTWritableCertStore &WritableCertStore(TInt)
    IMPORT_C TIntWritableCertStoreCount()
    Inherited Attributes
    CActive::iStatus
    Inherited Enumerations
    CActive:TPriority
    Inherited Functions
    CActive::CActive(TInt)
    CActive::Cancel()
    CActive::Deque()
    CActive::Extension_(TUint,TAny *&,TAny *)
    CActive::IsActive()const
    CActive::IsAdded()const
    CActive::Priority()const
    CActive::SetActive()
    CActive::SetPriority(TInt)
    CActive::~CActive()
    CBase::CBase()
    CBase::Delete(CBase *)
    CBase::operator new(TUint)
    CBase::operator new(TUint,TAny *)
    CBase::operator new(TUint,TLeave)
    CBase::operator new(TUint,TLeave,TUint)
    CBase::operator new(TUint,TUint)
    CBase::~CBase()

    Detailed Description

    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.

    Constructor & Destructor Documentation

    ~CUnifiedCertStore ( )

    IMPORT_C~CUnifiedCertStore()

    The destructor destroys all the resources owned by this object.

    Member Function Documentation

    Applications ( const CCTCertInfo &, RArray< TUid > &, TRequestStatus & )

    voidApplications(const CCTCertInfo &aCertInfo,
    RArray< TUid > &aApplications,
    TRequestStatus &aStatus
    )[virtual]

    Gets the list of applications . Applications are represented by UIDs .

    ParameterDescription
    aApplicationsAn array that the returned application UIDs are added to.
    aStatusThe request status object.

    CancelApplications ( )

    voidCancelApplications()[virtual]

    CancelGetCert ( )

    voidCancelGetCert()[virtual]

    CancelInitialize ( )

    IMPORT_C voidCancelInitialize()

    Cancels an ongoing Initialize() operation.

    The operation completes with KErrCancel.

    CancelIsApplicable ( )

    voidCancelIsApplicable()[virtual]

    CancelList ( )

    voidCancelList()[virtual]

    CancelRemove ( )

    IMPORT_C voidCancelRemove()

    Cancels an ongoing Remove() operation.

    The operation completes with KErrCancel.

    CancelRetrieve ( )

    voidCancelRetrieve()[virtual]

    CancelSetApplicability ( )

    IMPORT_C voidCancelSetApplicability()

    Cancels an ongoing SetApplicability() operation.

    The operation completes with KErrCancel.

    CancelSetTrust ( )

    IMPORT_C voidCancelSetTrust()

    Cancels an ongoing SetTrust() operation.

    The operation completes with KErrCancel.

    CancelTrusted ( )

    voidCancelTrusted()[virtual]

    CertStore ( TInt )

    IMPORT_C MCTCertStore &CertStore(TIntaIndex)

    Gets a particular certificate store.

    ParameterDescription
    aIndexThe index of the required certificate store. A number between 0 and CertStoreCount() - 1.

    Returns: The certificate store.

    CertStoreCount ( )

    IMPORT_C TIntCertStoreCount()const

    Gets the number of certificate stores.

    Returns: The total number of certificate stores.

    GetCert ( CCTCertInfo *&, const TCTTokenObjectHandle &, TRequestStatus & )

    voidGetCert(CCTCertInfo *&aCertInfo,
    const TCTTokenObjectHandle &aHandle,
    TRequestStatus &aStatus
    )[virtual]

    Initialize ( TRequestStatus & )

    IMPORT_C voidInitialize(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.

    ParameterDescription
    aStatusThe request status object; contains the result of the Initialize() request when complete. Set to KErrCancel if any outstanding request is cancelled.

    IsApplicable ( const CCTCertInfo &, TUid, TBool &, TRequestStatus & )

    voidIsApplicable(const CCTCertInfo &aCertInfo,
    TUidaApplication,
    TBool &aIsApplicable,
    TRequestStatus &aStatus
    )[virtual]

    List ( RMPointerArray< CCTCertInfo > &, const CCertAttributeFilter &, TRequestStatus & )

    voidList(RMPointerArray< CCTCertInfo > &aCertInfos,
    const CCertAttributeFilter &aFilter,
    TRequestStatus &aStatus
    )[virtual]

    Lists all certificates that satisfy the supplied filter.

    ParameterDescription
    aCertInfosAn array that the returned certificates are added to .
    aFilterA filter to restrict which certificates are returned.
    aStatusThe request status object.

    List ( RMPointerArray< CCTCertInfo > &, const CCertAttributeFilter &, const TDesC8 &, TRequestStatus & )

    IMPORT_C voidList(RMPointerArray< CCTCertInfo > &aCertInfos,
    const CCertAttributeFilter &aFilter,
    const TDesC8 &aIssuer,
    TRequestStatus &aStatus
    )

    Lists all certificates that have a particular subject DN.

    ParameterDescription
    aCertInfosAn array that the returned certificates are added to
    aFilterA filter to restrict which certificates are returned.
    aIssuerOnly certificates with this issuer DN will be returned
    aStatusAsynchronous request status.

    List ( RMPointerArray< CCTCertInfo > &, const CCertAttributeFilter &, RPointerArray< const TDesC8 >, TRequestStatus & )

    IMPORT_C voidList(RMPointerArray< CCTCertInfo > &aCertInfos,
    const CCertAttributeFilter &aFilter,
    RPointerArray< const TDesC8 >aIssuers,
    TRequestStatus &aStatus
    )

    Lists all certificates that have a particular issuer.

    ParameterDescription
    aCertInfosAn array that the returned certificates are added to
    aFilterA filter to restrict which certificates are returned.
    aIssuersOnly certificates with this issuer will be returned
    aStatusAsynchronous request status.

    NewL ( RFs &, TBool )

    IMPORT_C CUnifiedCertStore *NewL(RFs &aFs,
    TBoolaOpenForWrite
    )[static]

    Creates a new CUnifiedCertStore

    ParameterDescription
    aFsA file server session. It must already be open.
    aOpenForWriteETrue if the stores must be opened with write access (e.g. for adding certificates) and EFalse if the user only needs read-only access.

    Returns: A pointer to an instance of the CUnifiedCertStore class.

    NewL ( RFs &, TBool, RArray< TInt > & )

    IMPORT_C CUnifiedCertStore *NewL(RFs &aFs,
    TBoolaOpenForWrite,
    RArray< TInt > &aOrderFilter
    )[static]

    Creates a new CUnifiedCertStore with the sequence filter, so that multiple certstores that are managed by it will be filtered and ordered.

    ParameterDescription
    aFsA file server session. It must already be open.
    aOpenForWriteETrue if the stores must be opened with write access (e.g. for adding certificates) and EFalse if the user only needs read-only access. Ownership is taken.
    aOrderFilterAn array of the unique sequence IDs specifying CertStore ordering.

    Returns: A pointer to an instance of the CUnifiedCertStore class.

    NewLC ( RFs &, TBool )

    IMPORT_C CUnifiedCertStore *NewLC(RFs &aFs,
    TBoolaOpenForWrite
    )[static]

    Creates a new CUnifiedCertStore and pushes it on the cleanup stack.

    ParameterDescription
    aFsA file server session. It must already be open.
    aOpenForWriteETrue if the stores must be opened with write access (e.g. for adding certificates) and EFalse if the user only needs read-only access.

    Returns: A pointer to an instance of the CUnifiedCertStore class.

    NewLC ( RFs &, TBool, RArray< TInt > & )

    IMPORT_C CUnifiedCertStore *NewLC(RFs &aFs,
    TBoolaOpenForWrite,
    RArray< TInt > &aOrderFilter
    )[static]

    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.

    ParameterDescription
    aFsA file server session. It must already be open.
    aOpenForWriteETrue if the stores must be opened with write access (e.g. for adding certificates) and EFalse if the user only needs read-only access. Ownership is taken.
    aOrderFilterAn array of the unique sequence IDs specifying CertStore ordering.

    Returns: A pointer to an instance of the CUnifiedCertStore class.

    ReadOnlyCertStore ( TInt )

    IMPORT_C MCTCertStore &ReadOnlyCertStore(TIntaIndex)

    Gets a particular read-only certificate store.

    ParameterDescription
    aIndexThe index of the required certificate store. A number between 0 and ReadOnlyCertStoreCount() - 1.

    Returns: The read-only certificate store.

    ReadOnlyCertStoreCount ( )

    IMPORT_C TIntReadOnlyCertStoreCount()const

    Gets the number of read-only certificate stores.

    Returns: The number of read-only certificate stores.

    Remove ( const CCTCertInfo &, TRequestStatus & )

    IMPORT_C voidRemove(const CCTCertInfo &aCertInfo,
    TRequestStatus &aStatus
    )

    Removes a certificate.

    capability
    WriteUserData This requires the WriteUserData capability when applied to user certificates.
    capability
    WriteDeviceData This requires the WriteDeviceData capability when applied to CA certificates.
    leave
    KErrPermissionDenied If the caller doesn't have the required capabilities.
    ParameterDescription
    aCertInfoThe certificate to be removed.
    aStatusThe request status object; contains the result of the Remove() request when complete. Set to KErrCancel if an outstanding request is cancelled.

    Retrieve ( const CCTCertInfo &, TDes8 &, TRequestStatus & )

    voidRetrieve(const CCTCertInfo &aCertInfo,
    TDes8 &aEncodedCert,
    TRequestStatus &aStatus
    )[virtual]

    Retrieve ( const CCTCertInfo &, CCertificate *&, TRequestStatus & )

    IMPORT_C voidRetrieve(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.

    capability
    ReadUserData This requires the ReadUserData capability when applied to user certificates, as these may contain sensitive user data.
    leave
    KErrPermissionDenied If called for a user certificate when the caller doesn't have the ReadUserData capability.
    ParameterDescription
    aCertInfoThe certificate to retrieve
    aCertThe returned certificate. This object can safely be up-cast to a CX509Certificate or CWTLSCertificate if it's known that that is the certificate format.
    aStatusAsynchronous request status.

    SetApplicability ( const CCTCertInfo &, const RArray< TUid > &, TRequestStatus & )

    IMPORT_C voidSetApplicability(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.

    capability
    WriteDeviceData This requires the WriteDeviceData capability.
    leave
    KErrPermissionDenied If the caller doesn't have the required capabilities.
    ParameterDescription
    aCertInfoThe certificate whose applicability should be updated.
    aApplicationsThe new applicability settings. Ownership of this remains with the caller, and it must remain valid for the lifetime of the call.
    aStatusThe request status object; contains the result of the SetApplicability() request when complete. Set to KErrCancel, if an outstanding request is cancelled.

    SetTrust ( const CCTCertInfo &, TBool, TRequestStatus & )

    IMPORT_C voidSetTrust(const CCTCertInfo &aCertInfo,
    TBoolaTrusted,
    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.

    capability
    WriteDeviceData This requires the WriteDeviceData capability.
    leave
    KErrPermissionDenied If the caller doesn't have the required capabilities.
    ParameterDescription
    aCertInfoThe certificate to be updated.
    aTrustedETrue, if trusted; EFalse, otherwise.
    aStatusThe request status object; contains the result of the SetTrust() request when complete. Set to KErrCancel, if an outstanding request is cancelled.

    Trusted ( const CCTCertInfo &, TBool &, TRequestStatus & )

    voidTrusted(const CCTCertInfo &aCertInfo,
    TBool &aTrusted,
    TRequestStatus &aStatus
    )[virtual]

    WritableCertStore ( TInt )

    IMPORT_C MCTWritableCertStore &WritableCertStore(TIntaIndex)

    Gets a particular writeable certificate store.

    ParameterDescription
    aIndexThe index of the required certificate store. A number between 0 and WriteableCertStoreCount() - 1.

    Returns: The writeable certificate store.

    WritableCertStoreCount ( )

    IMPORT_C TIntWritableCertStoreCount()const

    Gets the number of writeable certificate stores.

    Returns: The number of writeable certificate stores.