drm_plat/drm_service_api/inc/drmserviceapi.h
changeset 0 95b198f216e5
child 31 908beac81e0a
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Service api which exposes some of the private functionality
       
    15 *                as a domain API
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef C_CDRMSERVICEAPI_H
       
    21 #define C_CDRMSERVICEAPI_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include "drmtypes.h"
       
    25 
       
    26 // Forward declarations
       
    27 class RDRMClockClient;
       
    28 
       
    29 namespace Roap
       
    30     {
       
    31     class RRoapStorageClient;   
       
    32     }
       
    33 
       
    34 
       
    35 namespace DRM 
       
    36     {
       
    37 
       
    38 /**
       
    39  *  Drm Service Api which provides access to some drm private functionality
       
    40  *
       
    41  *  @lib DrmServiceAPI.lib
       
    42  *  @since S60 v3.2
       
    43  */
       
    44 NONSHARABLE_CLASS( CDrmServiceApi ) : public CBase
       
    45     {
       
    46 
       
    47 public:
       
    48 
       
    49     /**
       
    50      * Two-phased constructor
       
    51      *
       
    52      * Creates a function CDrmServiceApi -object and returns a pointer to it
       
    53      * pointer is owned by the caller
       
    54      *
       
    55      * @since   S60 v3.2
       
    56      * @return  Symbian OS error code if any.
       
    57      */
       
    58     IMPORT_C static CDrmServiceApi* NewL();
       
    59 
       
    60     /**
       
    61      * Two-phased constructor
       
    62      *
       
    63      * Creates a function CDrmServiceApi -object and returns a pointer to it
       
    64      * pointer is owned by the caller, the pointer is left to the cleanup stack
       
    65      *
       
    66      * @since   S60 v3.2
       
    67      * @return  Symbian OS error code if any.
       
    68      */
       
    69     IMPORT_C static CDrmServiceApi* NewLC();
       
    70 
       
    71     /**
       
    72     * Destructor.
       
    73     */
       
    74     virtual ~CDrmServiceApi();
       
    75 
       
    76 
       
    77     /**
       
    78      * Get the secure time
       
    79      *
       
    80      * @since   S60 v3.2
       
    81      * @param   aTime           Output parameter containing the 
       
    82      *                          secure time in UTC.
       
    83      * @param   aTimeZone       Time zone information including summer/winter time
       
    84      *                          in +/- 15 minutes
       
    85      * @param   aSecurityLevel  Output parameter Securiry level.
       
    86      * @return  Symbian OS error code if any.
       
    87      */
       
    88     IMPORT_C TInt GetSecureTime( TTime& aTime, 
       
    89                                  TInt& aTimeZone,
       
    90                                  DRMClock::ESecurityLevel& aSecurityLevel ) const;
       
    91                         
       
    92     /**
       
    93      * Update the secure time
       
    94      *
       
    95      * Requires DRM Capability
       
    96      *
       
    97      * @since   S60 v3.2
       
    98      * @param   aTime           Input parameter containing the 
       
    99      *                          secure time in UTC.
       
   100      * @param   aTimeZone       Time zone information including 
       
   101      *                          summer/winter time
       
   102      *                          in +/- 15 minutes         
       
   103      * @return  Symbian OS error code if any.
       
   104      */
       
   105     IMPORT_C TInt UpdateSecureTime( const TTime& aTime, const TInt& aTimeZone );
       
   106 
       
   107 
       
   108     /**
       
   109      * Get the device public key in Der format
       
   110      *
       
   111      * @since   S60 v3.2
       
   112      * @param   aPublicKey      Return parameter for the public key owned by
       
   113      *                          the caller
       
   114      * @return  none
       
   115      * @leave Symbian OS error code
       
   116      */
       
   117     IMPORT_C void GetDevicePublicKeyDerL( HBufC8*& aPublicKey );
       
   118 
       
   119     /**
       
   120      * Sign the value given
       
   121      *
       
   122      * @since   S60 v3.2
       
   123      * @param   aHash           Value to be signed
       
   124      * @param   aSignature      Return parameter for the signature, owned by
       
   125      *                          the caller
       
   126      * @return  none
       
   127      * @leave Symbian OS error code
       
   128      */
       
   129     IMPORT_C void SignL( const TDesC8& aHash, HBufC8*& aSignature );
       
   130 
       
   131 private:
       
   132 
       
   133     /**
       
   134     * Default constructor
       
   135     */
       
   136     CDrmServiceApi();
       
   137 
       
   138     /**
       
   139     * 2nd phase constructor
       
   140     */
       
   141     void ConstructL();
       
   142 
       
   143 
       
   144 private: // data
       
   145     /**
       
   146     * Owned clock client
       
   147     */
       
   148     RDRMClockClient* iClockClient;
       
   149     
       
   150     /**
       
   151     * Owned roap storage client
       
   152     */
       
   153     Roap::RRoapStorageClient* iRoapStorageClient;
       
   154     };
       
   155     
       
   156     }
       
   157 
       
   158 #endif // C_CDRMSERVICEAPI_H