omadrm/drmengine/keystorage/inc/DrmStdKeyStorage.h
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 #ifndef DRMSTDKEYSTORAGE_H
       
    21 #define DRMSTDKEYSTORAGE_H
       
    22 
       
    23 // FORWARD DECLARATIONS
       
    24 
       
    25 class CRSAPrivateKeyStandard;
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30 *  CDrmKeyStorage: Contains key storage for OMA DRM 2.0
       
    31 *
       
    32 *  @lib    -
       
    33 *  @since  3.0
       
    34 */
       
    35 NONSHARABLE_CLASS(CDrmStdKeyStorage): public MDrmKeyStorage, public CBase
       
    36     {
       
    37 public: // New functions
       
    38 
       
    39     IMPORT_C static CDrmStdKeyStorage* NewL(RLibrary aLibrary);
       
    40     
       
    41     virtual ~CDrmStdKeyStorage();
       
    42     
       
    43 public: // From MDrmKeyStorage
       
    44 
       
    45     TInt ModulusSize();
       
    46 
       
    47     void SelectTrustedRootL(
       
    48         const TDesC8& aRootKeyHash);
       
    49         
       
    50     void SelectDefaultRootL();
       
    51         
       
    52     TBool SelectedRootIsCmla();
       
    53         
       
    54     void GetTrustedRootsL(
       
    55         RPointerArray<HBufC8>& aRootList);
       
    56         
       
    57     void GetCertificateChainL(
       
    58         RPointerArray<HBufC8>& aCertChain);
       
    59         
       
    60     HBufC8* RsaSignL(
       
    61         const TDesC8& aInput);
       
    62     
       
    63     HBufC8* RsaDecryptL(
       
    64         const TDesC8& aInput);
       
    65         
       
    66     void ImportDataL(
       
    67         const TDesC8& aPrivateKey,
       
    68         const RArray<TPtrC8>& aCertificateChain);
       
    69         
       
    70     void GetDeviceSpecificKeyL(
       
    71         TBuf8<KDeviceSpecificKeyLength>& aKey);
       
    72 
       
    73     void GetRdbSerialNumberL(
       
    74     	TBuf8<KRdbSerialNumberLength>& aSerialNumber);
       
    75     	
       
    76 	void GenerateNewRdbSerialNumberL();
       
    77 	
       
    78 	HBufC8* UdtEncryptL(
       
    79 	    const TDesC8& aInput);
       
    80 	    
       
    81     void GetRootCertificatesL(
       
    82         RPointerArray<HBufC8>& aRootCerts);
       
    83      
       
    84     void RandomDataGetL( 
       
    85         TDes8& aData, 
       
    86         const TInt aLength ); 
       
    87     	
       
    88 protected: // New functions
       
    89 
       
    90     void ConstructL();
       
    91     
       
    92     CDrmStdKeyStorage(RLibrary aLibrary);
       
    93     
       
    94     HBufC8* ModularExponentiateWithKeyL(
       
    95         const TDesC8& aInput);
       
    96         
       
    97     void InitializeKeyL();
       
    98     
       
    99     void CheckRootForCmlaL();
       
   100     
       
   101     const TDesC& GetImeiL();
       
   102     
       
   103 protected: // Data
       
   104 
       
   105     RFs iFs;
       
   106     CFileMan* iFileMan;    
       
   107     TBool iRootSelected;
       
   108     TBool iRootIsCmla;
       
   109     CRSAPrivateKeyStandard* iKey;
       
   110     TBuf8<KDeviceSpecificKeyLength> iDeviceSpecificKey;
       
   111     HBufC* iImei;
       
   112     RLibrary iLibrary;
       
   113 
       
   114     };
       
   115 
       
   116 #endif      // DRMSTDKEYSTORAGE_H
       
   117             
       
   118 // End of File