epoc32/include/mw/oma2agent.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 oma2agent.h
     1 /*
       
     2 * Copyright (c) 2005 - 2009 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Contains the OMA DRM CAF Agent specific data types, commands
       
    15 *                and attributes
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef OMA2AGENT_H
       
    22 #define OMA2AGENT_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <caf/caftypes.h>
       
    26 
       
    27 // CONSTANTS
       
    28 _LIT(KOmaDrm2AgentName, "OMA DRM Agent");
       
    29 _LIT8(KOma1DrmMessageContentType, "application/vnd.oma.drm.message");
       
    30 _LIT8(KOma1XmlRoContentType, "application/vnd.oma.drm.rights+xml");
       
    31 _LIT8(KOma1WbxmlRoContentType, "application/vnd.oma.drm.rights+wbxml");
       
    32 _LIT8(KOma2RoContentType, "application/vnd.oma.drm.roap-pdu+xml");
       
    33 _LIT8(KOma2ProtectedRoType, "application/vnd.oma.drm.ro+xml");
       
    34 _LIT8(KOma2TriggerContentType, "application/vnd.oma.drm.roap-trigger+xml");
       
    35 _LIT8(KOma1DcfContentType, "application/vnd.oma.drm.content");
       
    36 _LIT8(KOma2DcfContentType, "application/vnd.oma.drm.dcf");
       
    37 _LIT8(KOmaImportContentType, "application/x-vnd.oma.drm.import");
       
    38 _LIT8(KOmaImportMimeTypeField, "Content-type");
       
    39 _LIT8(KOmaImportRightsField, "Rights");
       
    40 _LIT8(KOma2DcfRoBoxId, "cid:Oma2DcfRightsObjectBox@localhost");
       
    41 _LIT8(KOma2DcfTransactionBoxId, "cid:Oma2DcfTransactionBox@localhost");
       
    42 _LIT8(KOma2DcfBranding, "\000\000\000\024ftypodcf\000\000\000\002odcf");
       
    43 _LIT8(KCafMimeType, "application/x-caf");
       
    44 _LIT(KOma1DcfExtension, ".dcf");
       
    45 _LIT(KOma2DcfExtension, ".odf");
       
    46 _LIT(KOma2DcfExtensionAudio, ".o4a");
       
    47 _LIT(KOma2DcfExtensionVideo, ".o4v");
       
    48 
       
    49 // DATA TYPES
       
    50 
       
    51 // Transport scheme for encrypted rights objects
       
    52 
       
    53 enum TKeyTransportScheme
       
    54     {
       
    55     EOma,
       
    56     ECmlaIp1,
       
    57     ECmlaIp2,
       
    58     ECmlaIp3,
       
    59     ECmlaIp4,
       
    60     ECmlaIp5,
       
    61     ECmlaIp6,
       
    62     ECmlaIp7,
       
    63     };
       
    64 
       
    65 namespace ContentAccess
       
    66 {
       
    67 // Agent specific attribute identifiers
       
    68 
       
    69 enum TOma2AgentAttribute
       
    70     {
       
    71     EFileType = EAgentSpecificAttributeBase + 1,
       
    72     EPreviewType,
       
    73     ESilentRightsType,
       
    74     EDeliveryMethod,
       
    75     ERecordingYear
       
    76     };
       
    77 
       
    78 enum TOma2AgentStringAttribute
       
    79     {
       
    80     EInstantPreviewUri = EAgentSpecificAttributeBase + 1,
       
    81     EPreviewRightsUri,
       
    82     ERightsIssuerUrl,
       
    83     ESilentRightsUrl,
       
    84     ETransactionTrackingId,
       
    85     EEmbeddedRightsObject,
       
    86     EGroupId,
       
    87     EDomainRightsIssuerUrl,
       
    88     EDomainId,
       
    89     EDomainRightsIssuerId,
       
    90     EContentVendor,
       
    91     ECopyright,
       
    92     EContentName,
       
    93     EOmaDrmContentLocation,
       
    94     EOmaDrmContentVersion,
       
    95     EPerformer,
       
    96     EOmaDrmGenre,
       
    97     ERatingInfo,
       
    98     EClassificationInfo,
       
    99     EKeyword,
       
   100     ELocInfoName,
       
   101     ELocInfoAstronomicalBody,
       
   102     ELocInfoAdditionalNotes,
       
   103     EAlbumTitle,
       
   104     EAlbumTrack,
       
   105     ECoverUri,
       
   106     ELyricsUrl,
       
   107     EFileName
       
   108     };
       
   109 
       
   110 // File types
       
   111 // EOma1DcfBased, The file type is derived from Oma1Dcf but has some extensions to it
       
   112 enum
       
   113     {
       
   114     ENoDcf = 0,
       
   115     EOma1Dcf = 1,
       
   116     EOma2Dcf = 2,
       
   117     EOma1DcfBased = 4 
       
   118     };
       
   119 
       
   120 // Delivery method
       
   121 
       
   122 enum TOmaDrmDeliveryMethod
       
   123     {
       
   124     EOmaDrm1LocalDataFile,
       
   125     EOmaDrm1ForwardLock,
       
   126     EOmaDrm1ForwardLockDcf,
       
   127     EOmaDrm1CombinedDelivery,
       
   128     EOmaDrm1CombinedDeliveryDcf,
       
   129     EOmaDrm1SeparateDelivery,
       
   130     EOmaDrm2
       
   131     };
       
   132 
       
   133 // Encryption methods for OMA DRM 2 DCF files
       
   134 
       
   135 enum TEncryptionMethod
       
   136     {
       
   137     EMethodNULL = 0x00,
       
   138     EMethodAES_128_CBC = 0x01,
       
   139     EMethodAES_128_CTR = 0x02
       
   140     };
       
   141 
       
   142 // Padding options
       
   143 
       
   144 enum TEncryptionPadding
       
   145     {
       
   146     EPaddingNone = 0x00,
       
   147     EPaddingRFC_2630 = 0x01
       
   148     };
       
   149 
       
   150 // Rights refresh and preview options
       
   151 
       
   152 enum TSilentRefresh
       
   153     {
       
   154     ENoSilentRefresh = 0x00,
       
   155     EOnDemand = 0x01,
       
   156     EInAdvance = 0x02
       
   157     };
       
   158 
       
   159 enum TPreview
       
   160     {
       
   161     ENoPreview = 0x00,
       
   162     EInstantPreview = 0x01,
       
   163     EPreviewRights = 0x02
       
   164     };
       
   165 
       
   166 // Rights Object version (stored in the iVersionMain field of the version)
       
   167 
       
   168 enum
       
   169     {
       
   170     EOma1Rights = 1,
       
   171     EOma2Rights = 2,
       
   172     ECmlaRights = 3
       
   173     };
       
   174 
       
   175 // Agent specific commands
       
   176 
       
   177 enum
       
   178     {
       
   179     /**
       
   180     * Embed any present domain RO into a CContent object
       
   181     * Works as an agent specific command for CContent
       
   182     * Input buffer: unused
       
   183     * Output buffer: unused
       
   184     */
       
   185     EEmbedDomainRo,
       
   186 
       
   187     /**
       
   188     * Return the supported OMA DRM methods
       
   189     * Works as an agent specific command for CManager
       
   190     * Input buffer: unused
       
   191     * Output buffer: String containing the following tokens
       
   192     *                FL if OMA DRM 1.0 Forward Lock is supported
       
   193     *                CD if OMA DRM 1.0 Combined Delivery is supported
       
   194     *                SD if OMA DRM 1.0 Separate Delivery is supported
       
   195     *                OMADRM2 if OMA DRM 2.0 is supported
       
   196     */
       
   197     EOmaDrmMethods,
       
   198 
       
   199     /**
       
   200     * Set the value of the x-oma header
       
   201     * works as an agent specific command for CManager
       
   202     * Input buffer: String containing the following data
       
   203     *               4 bytes(TInt) | ContentURI
       
   204     * Output buffer: unused
       
   205     */
       
   206     ESetPendingRightsETA,
       
   207 
       
   208     /**
       
   209     * Checks whether a memory buffer contains an OMA DRM 1.0 DCF
       
   210     * Input buffer: Memory buffer to check
       
   211     * Output buffer: unused
       
   212     * Return value: KErrNone if the buffer contains a DCF
       
   213     */
       
   214     EBufferContainsOma1Dcf,
       
   215 
       
   216     /**
       
   217     * Decrypt an OMA DRM 1.0 DCF memory buffer
       
   218     * Input buffer: Intent of the decryption (EPlay, ...) in the first byte,
       
   219     *               followed by the memory buffer to decrypt
       
   220     * Output buffer: Decrypted data
       
   221     */
       
   222     EDecryptOma1DcfBuffer,
       
   223 
       
   224 
       
   225     /**
       
   226     * Set the content name
       
   227     * Input buffer: first memory buffer 4 bytes of length of the content name |
       
   228     *               memory buffer of the new content name |
       
   229     *               content id
       
   230     * Output buffer: unused
       
   231     */
       
   232     ESetContentName,
       
   233 
       
   234     };
       
   235 }
       
   236 
       
   237 #endif      // OMA2AGENT_H
       
   238 
       
   239 // End of File