pkiutilities/DeviceToken/Inc/TrustedSitesStore.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   The header file of TrustedSitesStore
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __TRUSTEDSITESSTORE_H__
       
    21 #define __TRUSTEDSITESSTORE_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class RDevTokenClientSession;
       
    26 
       
    27 /**
       
    28  * Handle trusted sites store
       
    29  *
       
    30  * The class implementes the interface to handle the trust sites store.
       
    31  * Trusted sites are stored associated with certificates, which means for this
       
    32  * site the attached certificate is trusted.
       
    33  * 
       
    34  *  @lib DevTokenClient.dll
       
    35  *  @since S60 v3.2
       
    36  */
       
    37 class CTrustSitesStore : public CBase
       
    38     {
       
    39     public:  
       
    40         IMPORT_C static CTrustSitesStore* NewL();
       
    41         IMPORT_C virtual ~CTrustSitesStore();
       
    42 
       
    43     public: // New functions
       
    44 
       
    45         /**
       
    46          * add new trust record to trust site store
       
    47          *
       
    48          * @param aCert a certificate
       
    49          * @param aSiteName trusted site name
       
    50          * @return 
       
    51          */
       
    52         IMPORT_C TInt AddL( const TDesC8& aCert, const TDesC& aTrustedSite );
       
    53         
       
    54         
       
    55         /**
       
    56          * add forgiven site 
       
    57          *
       
    58          * @param aSite the untrusted certificate from this site is allowed
       
    59          * @param aIsOutOfDateAllowed outofdate certificate is allowed 
       
    60          * @return 
       
    61          */
       
    62         IMPORT_C TInt AddForgivenSiteL( const TDesC& aSite, const TBool& aIsOutOfDateAllowed );        
       
    63         
       
    64         /**
       
    65          * Remove forgiven sites set by this client 
       
    66          *
       
    67          * @param aSite, empty then remove all of the forgiven sites set by the client
       
    68          *               otherwise, remove the given site from forgiven site list
       
    69          * @return 
       
    70          */
       
    71         IMPORT_C TInt RemoveForgivenSiteL( const TDesC& aSite = KNullDesC );
       
    72         
       
    73         
       
    74         /**
       
    75          * check whether the given cert is trusted for the given site
       
    76          *
       
    77          * @param aCert a certificate
       
    78          * @param aSiteName trusted site name
       
    79          * @return ETrue /EFalse
       
    80          */
       
    81         IMPORT_C TBool IsTrustedSiteL( const TDesC8& aCert, const TDesC& aTrustedSite );
       
    82         
       
    83         /**
       
    84          * check whether out of date certificate is allowed for this site
       
    85          *
       
    86          * @param aCertificate 
       
    87          * @param aTrustedSite 
       
    88          * @return ETrue/EFalse
       
    89          */
       
    90         IMPORT_C TBool IsOutOfDateAllowedL( const TDesC8& aCertificate, const TDesC& aTrustedSite );
       
    91         
       
    92         /**
       
    93          * list all of the sites for which the cert is trusted
       
    94          *
       
    95          * @param aCert a certificate
       
    96          * @param aListOfSites trusted sites' name
       
    97          * @param aMessage IPC message
       
    98          * @return ETrue /EFalse
       
    99          */
       
   100         IMPORT_C TInt GetTrustedSitesL( const TDesC8& aCert, RPointerArray<HBufC>& aListOfSites );
       
   101 
       
   102     private:
       
   103         
       
   104         CTrustSitesStore();
       
   105         
       
   106         void ConstructL();
       
   107         
       
   108         void FreeRequestBuffer();
       
   109         
       
   110         TInt AllocRequestBuffer(TInt aReqdSize);
       
   111         
       
   112         void SendSyncRequestAndHandleOverflowL(TInt aInitialBufSize,
       
   113                                                const TIpcArgs& aArgs);
       
   114 
       
   115     private:
       
   116         
       
   117         RDevTokenClientSession* iClientSession;
       
   118         
       
   119         HBufC8* iRequestDataBuf;    
       
   120         
       
   121         TPtr8 iRequestPtr;
       
   122     };
       
   123 
       
   124 #endif //__TRUSTEDSITESSTORE_H__
       
   125 
       
   126 //EOF
       
   127