omadrm/drmengine/utils/src/CmlaCryptoStub.cpp
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32std.h>
       
    22 #include <asymmetric.h>
       
    23 #include <symmetric.h>
       
    24 #include <hash.h>
       
    25 #include "OmaCrypto.h"
       
    26 #include "CmlaCrypto.h"
       
    27 #include "BitStream.h"
       
    28 
       
    29 // LOCAL CONSTANTS AND MACROS
       
    30 
       
    31 _LIT8(KOma, "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-1#rsaes-kem-kdf2-kw-aes128");
       
    32 _LIT8(KCmlaIp1, "http://www.cm-la.com/tech/cmlaip/cmlaip#cmlaip-1");
       
    33 _LIT8(KCmlaIp2, "http://www.cm-la.com/tech/cmlaip/cmlaip#cmlaip-2");
       
    34 _LIT8(KCmlaIp3, "http://www.cm-la.com/tech/cmlaip/cmlaip#cmlaip-3");
       
    35 _LIT8(KCmlaIp4, "http://www.cm-la.com/tech/cmlaip/cmlaip#cmlaip-4");
       
    36 _LIT8(KCmlaIp5, "http://www.cm-la.com/tech/cmlaip/cmlaip#cmlaip-5");
       
    37 _LIT8(KCmlaIp6, "http://www.cm-la.com/tech/cmlaip/cmlaip#cmlaip-6");
       
    38 _LIT8(KCmlaIp7, "http://www.cm-la.com/tech/cmlaip/cmlaip#cmlaip-7");
       
    39 
       
    40 // ==================== LOCAL FUNCTIONS ====================
       
    41 
       
    42 // ============================ MEMBER FUNCTIONS ===============================
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CmlaCrypto::
       
    46 // 
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 // -----------------------------------------------------------------------------
       
    50 // CmlaCrypto::
       
    51 // 
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 EXPORT_C TInt CmlaCrypto::SupportedAlgorithmsL(
       
    55     RArray<TPtrC8>& /*aAlgorithmList*/)
       
    56     {
       
    57     return KErrNotSupported;
       
    58     }
       
    59 
       
    60 EXPORT_C HBufC8* CmlaCrypto::DdtPermL(
       
    61     const TDesC8& /*aInput*/)
       
    62     {
       
    63     return NULL;
       
    64     }
       
    65 
       
    66 EXPORT_C HBufC8* CmlaCrypto::DdtPermInvL(
       
    67     const TDesC8& /*aInput*/)
       
    68     {
       
    69     return NULL;
       
    70     }
       
    71 
       
    72 EXPORT_C HBufC8* CmlaCrypto::DdtExpL(
       
    73     const TDesC8& /*aInput*/)
       
    74     {
       
    75     return NULL;
       
    76     }
       
    77 
       
    78 EXPORT_C HBufC8* CmlaCrypto::DdtExpInvL(
       
    79     const TDesC8& /*aInput*/)
       
    80     {
       
    81     return NULL;
       
    82     }
       
    83 
       
    84 EXPORT_C HBufC8* CmlaCrypto::WrapL(
       
    85     const TDesC8& /*aKek*/,
       
    86     const TDesC8& /*aKey*/)
       
    87     {
       
    88     return NULL;
       
    89     }
       
    90 
       
    91 EXPORT_C HBufC8* CmlaCrypto::UnwrapL(
       
    92     const TDesC8& /*aKek*/,
       
    93     const TDesC8& /*aWrap*/)
       
    94     {
       
    95     return NULL;
       
    96     }
       
    97 
       
    98 EXPORT_C HBufC8* CmlaCrypto::KdfL(
       
    99     const TDesC8& /*aInput*/)
       
   100     {
       
   101     return NULL;
       
   102     }
       
   103 
       
   104 EXPORT_C HBufC8* CmlaCrypto::RsaDecryptCmlaL(
       
   105     MDrmKeyStorage* /*aKeyStorage*/,
       
   106     const TDesC8& /*aInput*/)
       
   107     {
       
   108     return NULL;
       
   109     }
       
   110 
       
   111 EXPORT_C HBufC8* CmlaCrypto::RsaEncryptCmlaL(
       
   112     CRSAPublicKey* /*aKey*/,
       
   113     const TDesC8& /*aInput*/)
       
   114     {
       
   115     return NULL;
       
   116     }
       
   117 
       
   118 EXPORT_C void CmlaCrypto::CmlaIpDecryptL(
       
   119     TKeyTransportScheme /*aTransportScheme*/,
       
   120     MDrmKeyStorage* /*aKeyStorage*/,
       
   121     const TDesC8& /*aInput*/,
       
   122     TDes8& /*aRek*/,
       
   123     TDes8& /*aMac*/)
       
   124     {
       
   125     User::Leave(KErrNotSupported);
       
   126     }
       
   127 
       
   128 EXPORT_C HBufC8* CmlaCrypto::CmlaIpEncryptL(
       
   129     TKeyTransportScheme /*aTransportScheme*/,
       
   130     CRSAPublicKey* /*aKey*/,
       
   131     const TDesC8& /*aRek*/,
       
   132     const TDesC8& /*aMac*/)
       
   133     {
       
   134     return NULL;
       
   135     }
       
   136 
       
   137 EXPORT_C TKeyTransportScheme CmlaCrypto::AlgorithmIdToTransportScheme(
       
   138     const TDesC8& aAlgorithmId)
       
   139     {
       
   140     if (aAlgorithmId.CompareF(KOma) == 0)
       
   141         {
       
   142         return EOma;
       
   143         }
       
   144     if (aAlgorithmId.CompareF(KCmlaIp1) == 0)
       
   145         {
       
   146         return ECmlaIp1;
       
   147         }
       
   148     if (aAlgorithmId.CompareF(KCmlaIp2) == 0)
       
   149         {
       
   150         return ECmlaIp2;
       
   151         }
       
   152     if (aAlgorithmId.CompareF(KCmlaIp3) == 0)
       
   153         {
       
   154         return ECmlaIp3;
       
   155         }
       
   156     if (aAlgorithmId.CompareF(KCmlaIp4) == 0)
       
   157         {
       
   158         return ECmlaIp4;
       
   159         }
       
   160     if (aAlgorithmId.CompareF(KCmlaIp5) == 0)
       
   161         {
       
   162         return ECmlaIp5;
       
   163         }
       
   164     if (aAlgorithmId.CompareF(KCmlaIp6) == 0)
       
   165         {
       
   166         return ECmlaIp6;
       
   167         }
       
   168     if (aAlgorithmId.CompareF(KCmlaIp7) == 0)
       
   169         {
       
   170         return ECmlaIp7;
       
   171         }
       
   172     return EOma;
       
   173     }
       
   174     
       
   175 //  End of File