os/security/securityanddataprivacytools/securitytools/certapp/test/tcertapp/badconfigwriter.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 #ifndef __BADCONFIGWRITER_H__
     2 #define __BADCONFIGWRITER_H__/*
     3 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     4 * All rights reserved.
     5 * This component and the accompanying materials are made available
     6 * under the terms of the License "Eclipse Public License v1.0"
     7 * which accompanies this distribution, and is available
     8 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 *
    10 * Initial Contributors:
    11 * Nokia Corporation - initial contribution.
    12 *
    13 * Contributors:
    14 *
    15 * Description: 
    16 *
    17 */
    18 
    19 
    20 #include <string>
    21 #include <fstream>
    22 #include <sstream>
    23 
    24 /**
    25 Class to create file to write the configuration inputs for store creation
    26 */
    27 class BadConfigWriter
    28 	{
    29 public:
    30 	BadConfigWriter(const std::stringstream &aFileName);
    31 	~BadConfigWriter();
    32 protected:
    33 	std::ofstream iFile;
    34 	};
    35 
    36 class FileBadCertStoreConfigWriter : public BadConfigWriter
    37 	{
    38 public:
    39 	FileBadCertStoreConfigWriter(const std::stringstream &aFileName);
    40 	~FileBadCertStoreConfigWriter();
    41 
    42 	void WriteFileEntry(const char *aBadLabel= 0,
    43 					const char *aBadDeletable = 0,
    44 					const char *aBadFormat= 0,
    45 					const char *aBadCertOwnerType = 0,
    46 					const char *aBadSubjectKeyId =0,
    47 					const char *aBadIssuerKeyId = 0,
    48 					const char *aBadApplication = 0,
    49 					const char *aBadTrusted = 0,
    50 					const char *aBadInvalidPath = 0);
    51 private:
    52 	int iEntryCount;
    53 	};
    54 
    55 class FileBadCertClientConfigWriter : public BadConfigWriter
    56 	{
    57 public:
    58 	FileBadCertClientConfigWriter(const std::stringstream &aFileName);
    59 	~FileBadCertClientConfigWriter();
    60 
    61 	void WriteCertClientName(const char *aArrayVal);
    62 	void WriteCertClientUid(const char *aArrayVal);
    63 	};
    64 
    65 class SwiBadCertStoreConfigWriter : public BadConfigWriter
    66 	{
    67 public:
    68 	SwiBadCertStoreConfigWriter(const std::stringstream &aFileName);
    69 	~SwiBadCertStoreConfigWriter();
    70 
    71 	void WriteSwiEntry(const char *aBadLabel= 0,
    72 					const char *aBadFormat= 0,
    73 					const char *aBadCertOwnerType = 0,
    74 					const char *aBadSubjectKeyId =0,
    75 					const char *aBadIssuerKeyId = 0,
    76 					const char *aBadApplication = 0,
    77 					const char *aBadTrusted = 0,
    78 					const char *aBadDatafilePath= 0,
    79 					const char *aBadCapabilitySet = 0,
    80 					const char *aBadMandatory = 0,
    81 					const char *aBadSystemUpgrade = 0);
    82 private:
    83 	int iEntryCount;
    84 	};
    85 
    86 
    87 #endif