inc/RoapStorageClient.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002-2008 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:  Client Class of ROAP Storage Server
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef ROAPSTORAGECLIENT_H
       
    21 #define ROAPSTORAGECLIENT_H
       
    22 
       
    23 #include <Oma2Agent.h>
       
    24 
       
    25 //  INCLUDES
       
    26 
       
    27 class CRSAPrivateKey;
       
    28 class CRSAPublicKey;
       
    29 class CDRMRIContext;
       
    30 class CDRMDomainContext;
       
    31 
       
    32 namespace Roap
       
    33     {
       
    34 
       
    35     // CLASS DECLARATION
       
    36 
       
    37     /**
       
    38     *  RRoapStorageClient
       
    39     *
       
    40     *  @lib drmserverinterfaces.lib
       
    41     *  @since Series 60 3.0
       
    42     */
       
    43     NONSHARABLE_CLASS( RRoapStorageClient ) : public RSessionBase
       
    44         {
       
    45     public:
       
    46         // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         */
       
    51         IMPORT_C RRoapStorageClient();
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         IMPORT_C virtual ~RRoapStorageClient();
       
    57 
       
    58     public:
       
    59         // New functions
       
    60 
       
    61         /**
       
    62         * ?member_description.
       
    63         * @since Series ?XX ?SeriesXX_version
       
    64         * @param ?arg1 ?description
       
    65         * @return ?description
       
    66         */
       
    67         //?type ?member_function( ?type ?arg1 );
       
    68         IMPORT_C TInt Connect();
       
    69 
       
    70         IMPORT_C TInt GetDevicePublicKeyL( CRSAPublicKey*& aPublicKey );
       
    71 
       
    72         IMPORT_C TInt GetDevicePublicKeyDerL( HBufC8*& aPublicKey );
       
    73 
       
    74         IMPORT_C TInt GetDevicePublicKeyHashL( TDes8& aHash );
       
    75 
       
    76         IMPORT_C TInt GetDeviceCertificateChainL(
       
    77             RPointerArray<HBufC8>& aCertChain );
       
    78 
       
    79         IMPORT_C TInt SignL( const TDesC8& aHash, HBufC8*& aSignature );
       
    80 
       
    81         IMPORT_C TInt RsaSignL( const TDesC8& aHash, HBufC8*& aSignature );
       
    82 
       
    83         IMPORT_C TBool VerifyL(
       
    84             const TDesC8& aSignature,
       
    85             const TDesC8& aHash,
       
    86             const RPointerArray<HBufC8>& aCertificateChain );
       
    87 
       
    88         IMPORT_C CDRMRIContext* GetRIContextL( const TDesC8& aRiID );
       
    89 
       
    90         IMPORT_C CDRMDomainContext* GetDomainContextL(
       
    91             const TDesC8& aDomainID );
       
    92 
       
    93         IMPORT_C void AddRIContextL( const CDRMRIContext& aRiContext );
       
    94 
       
    95         IMPORT_C void AddDomainContextL(
       
    96             const CDRMDomainContext& aDomainContext,
       
    97             const RPointerArray<HBufC8>& aMacs,
       
    98             const RPointerArray<HBufC8>& aDomainKeyElements,
       
    99             TKeyTransportScheme& aTransportScheme );
       
   100 
       
   101         IMPORT_C void DeleteRiContextL( const TDesC8& aRiID );
       
   102 
       
   103         IMPORT_C void DeleteDomainContextL( const TDesC8& aDomainID );
       
   104 
       
   105         IMPORT_C void DeleteExpiredRIsL( const TTime& aTime );
       
   106 
       
   107         IMPORT_C void DeleteExpiredDomainsL( const TTime& aTime );
       
   108 
       
   109         IMPORT_C void DeleteExpiredContextsL( const TTime& aTime );
       
   110 
       
   111         IMPORT_C void DeleteAllL();
       
   112 
       
   113         /*
       
   114         * WhiteListURLExistsL
       
   115         * @param aURL, url to be searched in white lists
       
   116         * @param (inout) aInPreconfiguredWhiteList
       
   117         *     as in parameter: define whether or not to search from
       
   118         *         pre-defined whitelist
       
   119         *         ETrue: given URL is not searched from whitelistURL
       
   120         *         EFalse: given URL is not searched from whitelistURL
       
   121         *     as out parameter: define whether or not url has been
       
   122         *         searched and found from pre-defined whitelist
       
   123         *         ETrue: parameter was initially false,
       
   124         *             hostname part of aURL does not match hostname part
       
   125         *             in any RI URL of any existing RI conext,
       
   126         *             and aURL matched at least one of pre-defined
       
   127         *             whitelist URLs
       
   128         *         EFalse otherwise
       
   129         *         @note EFalse also if hostname part of aURL
       
   130         *             matches any hostname part in any RI URLs
       
   131         *             of any existing RI context
       
   132         *
       
   133         * @return
       
   134         *     ETrue: aURL is in white list
       
   135         *     EFalse: aURL is not in white list
       
   136         */
       
   137         IMPORT_C TBool WhiteListURLExistsL( const TDesC8& aURL,
       
   138             TBool& aFromPreconfiguredWhiteList );
       
   139 
       
   140         IMPORT_C TInt SelectTrustedRootL(
       
   141             const RPointerArray<HBufC8>& aTrustedRoots,
       
   142             TDes8& aSelectedRoot ) const;
       
   143 
       
   144         IMPORT_C TInt SelectTrustedRootL( const TDesC8& aTrustedRoot ) const;
       
   145 
       
   146         IMPORT_C void
       
   147             GetTrustedRootsL( RPointerArray<HBufC8>& aTrustedRoots ) const;
       
   148 
       
   149         IMPORT_C HBufC8* GetRootCertificateL( const TDesC& aSubject ) const;
       
   150 
       
   151         IMPORT_C HBufC8* GetMeteringDataL(
       
   152             TDesC8& aRiId,
       
   153             TDes8& aMacKey,
       
   154             TDes8& aEncKeyHash,
       
   155             HBufC8*& aEncryptedMekAndMak );
       
   156 
       
   157         IMPORT_C void DeleteMeteringDataL( const TDesC8& aRiId );
       
   158 
       
   159         IMPORT_C void GetAllRIContextsL(
       
   160             RPointerArray<CDRMRIContext>& aRiContexts );
       
   161 
       
   162         IMPORT_C void UpdateRIContextL( const CDRMRIContext& aContext );
       
   163 
       
   164         IMPORT_C TBool UpdateDrmTimeL(
       
   165             const RPointerArray<HBufC8>& aCertChain,
       
   166             const RPointerArray<HBufC8>& aOCSPResponses,
       
   167             const TDesC8& aNonce );
       
   168 
       
   169         IMPORT_C TBool VerifyOcspResponsesL(
       
   170             const RPointerArray<HBufC8>& aOcspResponses,
       
   171             const TDesC8& aRiCaCert,
       
   172             const RPointerArray<HBufC8>& aCertSerialNums );
       
   173 
       
   174         IMPORT_C HBufC8* GetOcspResponderIdL( const TDesC8& aRiID );
       
   175 
       
   176 
       
   177     private:
       
   178 
       
   179         // Prohibit copy constructor if not deriving from CBase.
       
   180         RRoapStorageClient( const RRoapStorageClient& );
       
   181         // Prohibit assignment operator if not deriving from CBase.
       
   182         RRoapStorageClient& operator=( const RRoapStorageClient& );
       
   183 
       
   184         };
       
   185     }
       
   186 
       
   187 #endif // ROAPSTORAGECLIENT_H
       
   188 // End of File