williamr@2: /* williamr@2: * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: DRM License Checker interface definition williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef DRMLICENSECHECKER_H williamr@2: #define DRMLICENSECHECKER_H williamr@2: williamr@2: /** williamr@2: * Check and decrypt protected data files encrypted by the license manager. williamr@2: * williamr@2: * @lib DRMLicenseChecker.lib williamr@2: * @since Series 60 2.5 williamr@2: */ williamr@2: class CDRMLicenseChecker: public CBase williamr@2: { williamr@2: public: // Local enumerations and types williamr@2: williamr@2: enum williamr@2: { williamr@2: ENoRights = -100000, williamr@2: ERightsExpired = -100001, williamr@2: }; williamr@2: williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: */ williamr@2: IMPORT_C static CDRMLicenseChecker* NewL(); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CDRMLicenseChecker(); williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * This function performs a license check by decrypting a data file and williamr@2: * returning the decrypted contents of the data file. A license check williamr@2: * can only succeed if a rights object associated with the calling williamr@2: * application exists and sufficient rights are present. If the license williamr@2: * check fails, an error is returned. williamr@2: * williamr@2: * @since Series 60 2.6 williamr@2: * @param aDataFile: the data file to be decrypted williamr@2: * @param aDataBuffer: memory buffer which contains the decrypted williamr@2: * contents of the data file. williamr@2: * @return ENoRights, ERightsExpired if the data file could not be opened williamr@2: * because of insufficient rights, Symbian-wide error codes or williamr@2: * KErrNone in case of success. williamr@2: */ williamr@2: IMPORT_C TInt CheckLicense( williamr@2: const TDesC& aDataFile, williamr@2: HBufC8*& aDataBuffer); williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: CDRMLicenseChecker(); williamr@2: williamr@2: /** williamr@2: * By default Symbian 2nd phase constructor is private. williamr@2: */ williamr@2: void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Leaving version of CheckLicense williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aDataFile: the data file to be decrypted williamr@2: * @param aDataBuffer: memory buffer which contains the decrypted williamr@2: * contents of the data file. williamr@2: * @return ENoRights, ERightsExpired if the data file could not be opened williamr@2: * because of insufficient rights, Symbian-wide error codes or williamr@2: * KErrNone in case of success. williamr@2: */ williamr@2: void CheckLicenseL( williamr@2: const TDesC& aDataFile, williamr@2: HBufC8*& aDataBuffer); williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // DRMLICENSECHECKER_H williamr@2: williamr@2: // End of File