summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/SecureTransportEngine.h
blob: fbd97d6a616bfae1647ec08053e8b01e15a67f26 (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
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#ifndef ICESSL_SECURE_TRANSPORT_ENGINE_H
#define ICESSL_SECURE_TRANSPORT_ENGINE_H

#ifdef __APPLE__

#include <IceSSL/SSLEngine.h>
#include <Ice/UniqueRef.h>

#include <Security/Security.h>
#include <Security/SecureTransport.h>

namespace IceSSL
{

namespace SecureTransport
{

class SSLEngine : public IceSSL::SSLEngine
{
public:

    SSLEngine(const Ice::CommunicatorPtr&);

    virtual void initialize();
    virtual void destroy();
    virtual IceInternal::TransceiverPtr
    createTransceiver(const InstancePtr&, const IceInternal::TransceiverPtr&, const std::string&, bool);

    SSLContextRef newContext(bool);
    CFArrayRef getCertificateAuthorities() const;
    std::string getCipherName(SSLCipherSuite) const;

private:

    void parseCiphers(const std::string&);

    IceInternal::UniqueRef<CFArrayRef> _certificateAuthorities;
    IceInternal::UniqueRef<CFArrayRef> _chain;

    SSLProtocol _protocolVersionMax;
    SSLProtocol _protocolVersionMin;

#if TARGET_OS_IPHONE==0
    std::vector<char> _dhParams;
#endif
    std::vector<SSLCipherSuite> _ciphers;
};

} // SecureTransport namespace end

} // IceSSL namespace end

#endif

#endif