CWmDrmAccess Class Reference

class CWmDrmAccess : public CBase

Provides access to WM DRM protected files (e.g. decrypting services for WM DRM protected files)

        // Way to use CWmDrmAccess

  CWmDrmAccess* access( CWmDrmAccess::NewL() );
  // ...
  // fetch file header of the WM DRM protected file to be decrypted.
  // Assign it to initializationData
  // ...
  // Initialize with given initialisation data
  access->Initialize( initializationData );
  // ...
  // read encrypted data block to buffer
  // ...
  CWmDrmAccess->Decrypt( buffer );
  // use decrypted data in buffer
  // ...
  // when all data has been decrypted, close decryption context
  access->Close();
  delete access;
       

Inherits from

Constructor & Destructor Documentation

CWmDrmAccess()

CWmDrmAccess ( ) [private]

Default constructor

~CWmDrmAccess()

IMPORT_C ~CWmDrmAccess ( ) [virtual]

Destructor

Member Functions Documentation

Close()

IMPORT_C TInt Close ( )

Closes decryption context.

CWmDrmAccess::Initialize

ConstructL()

void ConstructL ( ) [private]

Second phase constructor

Decrypt(TDes8 &)

IMPORT_C TInt Decrypt ( TDes8 & aBuffer )

Decrypts encrypted data in place. This is for decrypting data of the file, header of which is used as initialisation parameter at CWmDrmAccess::Initialize .

One small sample describing the use of the function.
         RBuf8 buffer;
 // ...
 // Fetch encrypted data to buffer
 FetchEncryptedData( buffer );

 // Decrypt encrypted data.
 TInt error = access->Decrypt( buffer );
 if ( !error )
     {
     UseDecryptedData( buffer );
     }
        

CWmDrmAccess::Initialize CWmDrmAccess::Close

Parameters

TDes8 & aBuffer This will contain data to be decrypted. On successful completion, given data is decrypted in aBuffer.

Initialize(const TDesC8 &)

IMPORT_C TInt Initialize ( const TDesC8 & aHeader )

Initialises decryption context This initialises decryption session for given WM DRM protected file.

CWmDrmAccess::Close

Parameters

const TDesC8 & aHeader This parameter is for inputting header of the given WM DRM protected file to be decrypted to WM DRM system.

NewL()

IMPORT_C CWmDrmAccess * NewL ( ) [static]

Constructors

NewLC()

IMPORT_C CWmDrmAccess * NewLC ( ) [static]

Member Data Documentation

CWmDrmAccessEcomInterface * iWmDrmAccessEcomInterface

CWmDrmAccessEcomInterface * iWmDrmAccessEcomInterface [private]

Internal interface to the WM DRM system