omadrm/drmengine/roap/src/RightsReq.cpp
changeset 23 493788a4a8a4
parent 0 95b198f216e5
equal deleted inserted replaced
5:79d62d1d7957 23:493788a4a8a4
    17 
    17 
    18 
    18 
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 #include <e32std.h>
    21 #include <e32std.h>
    22 #include "base64.h"
    22 #include "Base64.h"
    23 #include "RightsReq.h"
    23 #include "RightsReq.h"
    24 
    24 
    25 using namespace Roap;
    25 using namespace Roap;
    26 
    26 
    27 // LOCAL CONSTANTS AND MACROS
    27 // LOCAL CONSTANTS AND MACROS
   106 // -----------------------------------------------------------------------------
   106 // -----------------------------------------------------------------------------
   107 //
   107 //
   108 CRightsReq* CRightsReq::NewL()
   108 CRightsReq* CRightsReq::NewL()
   109     {
   109     {
   110     CRightsReq* self = new( ELeave ) CRightsReq;
   110     CRightsReq* self = new( ELeave ) CRightsReq;
   111     
   111 
   112     CleanupStack::PushL( self );
   112     CleanupStack::PushL( self );
   113     self->ConstructL();
   113     self->ConstructL();
   114     CleanupStack::Pop();
   114     CleanupStack::Pop();
   115 
   115 
   116     return self;
   116     return self;
   117     }
   117     }
   118 
   118 
   119     
   119 
   120 // Destructor
   120 // Destructor
   121 CRightsReq::~CRightsReq()
   121 CRightsReq::~CRightsReq()
   122     {
   122     {
   123     iRoIdList.ResetAndDestroy();
   123     iRoIdList.ResetAndDestroy();
   124     iCertificateChain.ResetAndDestroy();
   124     iCertificateChain.ResetAndDestroy();
   195             BufAppendBase64L(b, *iCertificateChain[i]);
   195             BufAppendBase64L(b, *iCertificateChain[i]);
   196             BufAppendL(b, KReqCertEnd);
   196             BufAppendL(b, KReqCertEnd);
   197             }
   197             }
   198         BufAppendL(b, KReqCertChainEnd);
   198         BufAppendL(b, KReqCertChainEnd);
   199         }
   199         }
   200         
   200 
   201     if (iTransTrackIDs.Count() ||
   201     if (iTransTrackIDs.Count() ||
   202         iPeerKeyIdentifier.Length() ||
   202         iPeerKeyIdentifier.Length() ||
   203         iOcspResponderKeyId ||
   203         iOcspResponderKeyId ||
   204         iOcspInfoStored)
   204         iOcspInfoStored)
   205         {
   205         {
   206         BufAppendL(b, KReqExtensions);
   206         BufAppendL(b, KReqExtensions);
   207         }
   207         }
   208         
   208 
   209     if (iPeerKeyIdentifier.Length())
   209     if (iPeerKeyIdentifier.Length())
   210         {
   210         {
   211         BufAppendL(b, KReqPeerKey);
   211         BufAppendL(b, KReqPeerKey);
   212         BufAppendBase64L(b, iPeerKeyIdentifier);
   212         BufAppendBase64L(b, iPeerKeyIdentifier);
   213         BufAppendL(b, KReqPeerKeyEnd);
   213         BufAppendL(b, KReqPeerKeyEnd);
   214         }
   214         }
   215         
   215 
   216     if (iOcspInfoStored)
   216     if (iOcspInfoStored)
   217         {
   217         {
   218         BufAppendL(b, KReqNoOcspResponse);
   218         BufAppendL(b, KReqNoOcspResponse);
   219         }
   219         }
   220         
   220 
   221     if (iOcspResponderKeyId)
   221     if (iOcspResponderKeyId)
   222         {
   222         {
   223         BufAppendL(b, KReqOcspResponderKeyId);
   223         BufAppendL(b, KReqOcspResponderKeyId);
   224         BufAppendBase64L(b, *iOcspResponderKeyId);
   224         BufAppendBase64L(b, *iOcspResponderKeyId);
   225         BufAppendL(b, KReqOcspResponderKeyIdEnd);
   225         BufAppendL(b, KReqOcspResponderKeyIdEnd);
   226         }
   226         }
   227         
   227 
   228     for ( TInt i = 0; i < iTransTrackIDs.Count() && i < iContentIDs.Count(); i++ )
   228     for ( TInt i = 0; i < iTransTrackIDs.Count() && i < iContentIDs.Count(); i++ )
   229         {
   229         {
   230         BufAppendL(b, KReqTransactionContentId);
   230         BufAppendL(b, KReqTransactionContentId);
   231         BufAppendL(b, *iContentIDs[i]);
   231         BufAppendL(b, *iContentIDs[i]);
   232         BufAppendL(b, KReqTransactionContentIdEnd);
   232         BufAppendL(b, KReqTransactionContentIdEnd);
   233         BufAppendL(b, KReqTransactionId);
   233         BufAppendL(b, KReqTransactionId);
   234         BufAppendL(b, *iTransTrackIDs[i]);
   234         BufAppendL(b, *iTransTrackIDs[i]);
   235         BufAppendL(b, KReqTransactionIdEnd);
   235         BufAppendL(b, KReqTransactionIdEnd);
   236         }
   236         }
   237                
   237 
   238     if (iTransTrackIDs.Count() ||
   238     if (iTransTrackIDs.Count() ||
   239          iPeerKeyIdentifier.Length() ||
   239          iPeerKeyIdentifier.Length() ||
   240          iOcspResponderKeyId ||
   240          iOcspResponderKeyId ||
   241          iOcspInfoStored)
   241          iOcspInfoStored)
   242         {
   242         {
   249     r = b->Ptr(0).AllocL();
   249     r = b->Ptr(0).AllocL();
   250     CleanupStack::PopAndDestroy(b);
   250     CleanupStack::PopAndDestroy(b);
   251     return r;
   251     return r;
   252     }
   252     }
   253 
   253 
   254 //  End of File  
   254 //  End of File