summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/GeneralConfig.h
blob: 35596c1f4914fc5039eaa062cbc8a7537e777193 (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
// **********************************************************************
//
// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#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(const std::string&, const std::string&);

protected:

    SslProtocol _sslVersion;

    int _verifyMode;
    int _verifyDepth;

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

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

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

    return target;
}

}

#endif