javacommons/security/javaunicertstoreplugin/tsrc/utils/testdata.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 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 "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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef TESTDATA_H
       
    19 #define TESTDATA_H
       
    20 
       
    21 #include <f32file.h>
       
    22 #include <string>
       
    23 #include <list>
       
    24 
       
    25 _LIT(KCertMetaDataRootDir,"c:\\private\\200211dc\\security\\trustroots\\device\\state\\");
       
    26 const char CertMetaDataRootDir[] = "c:\\private\\200211dc\\security\\trustroots\\device\\state\\";
       
    27 
       
    28 _LIT(KCertDataRootDir,"c:\\private\\200211dc\\security\\trustroots\\device\\certificates\\");
       
    29 const char CertDataRootDir[] = "c:/private/200211dc/security/trustroots/device/certificates/";
       
    30 
       
    31 //const int DISABLED      = 0x1;
       
    32 //const int CAN_DISABLED  = 0x2;
       
    33 //const int CAN_DELETED   = 0x4;
       
    34 
       
    35 const int STATE_ENABLED = 3;
       
    36 const int STATE_DISABLED = 2;
       
    37 const int STATE_DELETED = 1;
       
    38 
       
    39 class CertMetaData
       
    40 {
       
    41 public:
       
    42 
       
    43     CertMetaData(int aState,const std::string& aNameOfCert,TBool aRemovable,TBool aDisablable,
       
    44                  const std::string& aHash,const std::string& aCertContent)
       
    45             : mState(aState),mNameOfCert(aNameOfCert),mRemovable(aRemovable),mDisablable(aDisablable),
       
    46             mHash(aHash),mCertContent(aCertContent) {}
       
    47 
       
    48     CertMetaData(const CertMetaData& x)
       
    49     {
       
    50         *this = x;
       
    51     }
       
    52 
       
    53     CertMetaData& operator=(const CertMetaData& x)
       
    54     {
       
    55         mState = x.mState;
       
    56         mNameOfCert = x.mNameOfCert;
       
    57         mRemovable = x.mRemovable;
       
    58         mDisablable = x.mDisablable;
       
    59         mHash = x.mHash;
       
    60         mCertContent = x.mCertContent;
       
    61         return *this;
       
    62     }
       
    63 
       
    64     int mState;
       
    65     std::string mNameOfCert;
       
    66     bool mRemovable;
       
    67     bool mDisablable;
       
    68     std::string mHash;
       
    69     std::string mCertContent;
       
    70 };
       
    71 
       
    72 class CTestData
       
    73 {
       
    74 public:
       
    75 
       
    76     static CTestData* NewL();
       
    77 
       
    78     virtual ~CTestData();
       
    79 
       
    80     void DeleteTestDataL();
       
    81 
       
    82     void StoreTestData(std::list<CertMetaData>& aTestData);
       
    83 
       
    84 private:
       
    85 
       
    86     RFs mRfs;
       
    87 
       
    88     CTestData();
       
    89     void ConstructL();
       
    90 
       
    91 };
       
    92 
       
    93 
       
    94 #endif // TESTDATA_H