epoc32/include/mw/drmlicensechecker.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  DRM License Checker interface definition
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef DRMLICENSECHECKER_H
williamr@2
    20
#define DRMLICENSECHECKER_H
williamr@2
    21
williamr@2
    22
/**
williamr@2
    23
*  Check and decrypt protected data files encrypted by the license manager.
williamr@2
    24
*
williamr@2
    25
*  @lib DRMLicenseChecker.lib
williamr@2
    26
*  @since Series 60 2.5
williamr@2
    27
*/
williamr@2
    28
class CDRMLicenseChecker: public CBase
williamr@2
    29
    {
williamr@2
    30
    public:  // Local enumerations and types
williamr@2
    31
williamr@2
    32
        enum
williamr@2
    33
            {
williamr@2
    34
            ENoRights = -100000,
williamr@2
    35
            ERightsExpired = -100001,
williamr@2
    36
            };
williamr@2
    37
williamr@2
    38
    public:  // Constructors and destructor
williamr@2
    39
        
williamr@2
    40
        /**
williamr@2
    41
        * Two-phased constructor.
williamr@2
    42
        */
williamr@2
    43
        IMPORT_C static CDRMLicenseChecker* NewL();
williamr@2
    44
        
williamr@2
    45
        /**
williamr@2
    46
        * Destructor.
williamr@2
    47
        */
williamr@2
    48
        IMPORT_C virtual ~CDRMLicenseChecker();
williamr@2
    49
williamr@2
    50
    public: // New functions
williamr@2
    51
        
williamr@2
    52
        /**
williamr@2
    53
        * This function performs a license check by decrypting a data file and
williamr@2
    54
        * returning the decrypted contents of the data file. A license check
williamr@2
    55
        * can only succeed if a rights object associated with the calling
williamr@2
    56
        * application exists and sufficient rights are present. If the license
williamr@2
    57
        * check fails, an error is returned.
williamr@2
    58
        *
williamr@2
    59
        * @since Series 60 2.6
williamr@2
    60
        * @param aDataFile: the data file to be decrypted
williamr@2
    61
        * @param aDataBuffer: memory buffer which contains the decrypted
williamr@2
    62
        *        contents of the data file.
williamr@2
    63
        * @return ENoRights, ERightsExpired if the data file could not be opened
williamr@2
    64
        *         because of insufficient rights, Symbian-wide error codes or
williamr@2
    65
        *         KErrNone in case of success.
williamr@2
    66
        */
williamr@2
    67
        IMPORT_C TInt CheckLicense(
williamr@2
    68
            const TDesC& aDataFile,
williamr@2
    69
            HBufC8*& aDataBuffer);
williamr@2
    70
williamr@2
    71
    private:
williamr@2
    72
williamr@2
    73
        /**
williamr@2
    74
        * C++ default constructor.
williamr@2
    75
        */
williamr@2
    76
        CDRMLicenseChecker();
williamr@2
    77
williamr@2
    78
        /**
williamr@2
    79
        * By default Symbian 2nd phase constructor is private.
williamr@2
    80
        */
williamr@2
    81
        void ConstructL();
williamr@2
    82
        
williamr@2
    83
        /**
williamr@2
    84
        * Leaving version of CheckLicense
williamr@2
    85
        *
williamr@2
    86
        * @since Series 60 3.0
williamr@2
    87
        * @param aDataFile: the data file to be decrypted
williamr@2
    88
        * @param aDataBuffer: memory buffer which contains the decrypted
williamr@2
    89
        *        contents of the data file.
williamr@2
    90
        * @return ENoRights, ERightsExpired if the data file could not be opened
williamr@2
    91
        *         because of insufficient rights, Symbian-wide error codes or
williamr@2
    92
        *         KErrNone in case of success.
williamr@2
    93
        */
williamr@2
    94
        void CheckLicenseL(
williamr@2
    95
            const TDesC& aDataFile,
williamr@2
    96
            HBufC8*& aDataBuffer);
williamr@2
    97
williamr@2
    98
    };
williamr@2
    99
williamr@2
   100
#endif      // DRMLICENSECHECKER_H   
williamr@2
   101
            
williamr@2
   102
// End of File