summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/GeneralConfig.h
blob: 967347adf292b6df54fdccef8d675490c3c8d550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// **********************************************************************
//
// Copyright (c) 2001
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef ICE_SSL_GENERAL_CONFIG_H
#define ICE_SSL_GENERAL_CONFIG_H

#include <IceSSL/OpenSSL.h>

namespace IceSSL
{

class GeneralConfig
{
public:

    GeneralConfig();

    SslProtocol getProtocol() const;
    int getVerifyMode() const;
    int getVerifyDepth() const;

    std::string getContext() const;
    std::string getCipherList() const;
    std::string getRandomBytesFiles() const;

    // General method - it will figure out how to properly parse the data.
    void set(std::string&, std::string&);

protected:

    SslProtocol _sslVersion;

    int _verifyMode;
    int _verifyDepth;

    std::string _context;
    std::string _cipherList;
    std::string _randomBytesFiles;

    void parseVersion(std::string&);
    void parseVerifyMode(std::string&);
};

template<class Stream> inline
Stream& operator << (Stream& target, const GeneralConfig& generalConfig)
{
    target << "Protocol:     " << generalConfig.getProtocol() << std::endl;
    target << "Verify Mode:  " << generalConfig.getVerifyMode() << std::endl;
    target << "Verify Depth: " << generalConfig.getVerifyDepth() << std::endl;
    target << "Context:      " << generalConfig.getContext() << std::endl;
    target << "Cipher List:  " << generalConfig.getCipherList() << std::endl;
    target << "Random Bytes: " << generalConfig.getRandomBytesFiles() << std::endl;

    return target;
}

}

#endif