00001 /***************************************************************** 00002 * 00003 * file: cdx_ssl_transport.h 00004 * desc: This file provides the CoreDX DDS SSL Transport API. 00005 * 00006 ***************************************************************** 00007 * 00008 * Copyright(C) 2006-2013 Twin Oaks Computing, Inc 00009 * All rights reserved. Castle Rock, CO 80108 00010 * 00011 ***************************************************************** 00012 * This software has been provided pursuant to a License Agreement 00013 * containing restrictions on its use. This software contains 00014 * valuable trade secrets and proprietary information of 00015 * Twin Oaks Computing, Inc and is protected by law. It may not be 00016 * copied or distributed in any form or medium, disclosed to third 00017 * parties, reverse engineered or used in any manner not provided 00018 * for in said License Agreement except with the prior written 00019 * authorization from Twin Oaks Computing, Inc. 00020 *****************************************************************/ 00021 #ifndef _COREDX_SSL_TRANSPORT_H 00022 #define _COREDX_SSL_TRANSPORT_H 00023 00024 #include <dds/coredx_transport.h> 00025 #include <dds/dds_seq.h> 00026 00027 #ifdef __cplusplus 00028 extern "C" { 00029 #endif 00030 00031 # if defined(__linux__) || defined(_WIN32) || defined(__MACH__) 00032 # define COREDX_HAS_SSL_TRANSPORT 1 00033 # endif 00034 00054 typedef struct CoreDX_SslTransportConfig { 00055 short participant_index; 00058 CoreDX_IpTransportInterfaceSeq interfaces; 00059 unsigned char dynamic_interfaces; 00060 int tx_max_packet_size; 00062 /* SERVER: */ 00063 const char * server_cert_file; 00064 const char * server_key_file; 00065 unsigned char server_verify_client; 00066 const char * server_verify_ca_list_file; 00067 const char * server_accept_ca_list_file; 00069 /* CLIENT: */ 00070 const char * client_cert_file; 00071 const char * client_key_file; 00072 const char * client_verify_ca_list_file; 00074 unsigned int debug_flags; 00075 } CoreDX_SslTransportConfig; 00076 00077 # define COREDX_SSL_TRANSPORT_CONFIG_DEFAULT NULL 00078 00085 COREDX_C_ADD_API DDS_ReturnCode_t CoreDX_SslTransport_get_default_config( CoreDX_SslTransportConfig * config ); 00093 COREDX_C_ADD_API DDS_ReturnCode_t CoreDX_SslTransport_get_env_config ( CoreDX_SslTransportConfig * config ); 00097 COREDX_C_ADD_API DDS_ReturnCode_t CoreDX_SslTransport_clear_config ( CoreDX_SslTransportConfig * config ); 00105 COREDX_C_ADD_API CoreDX_Transport * CoreDX_SslTransport_create_transport ( CoreDX_SslTransportConfig * config ); 00131 COREDX_C_ADD_API DDS_ReturnCode_t CoreDX_SslTransport_get_peer_cert ( CoreDX_Transport * ssl_transport, 00132 DDS_BuiltinTopicKey_t * participant_key, 00133 DDS_BuiltinTopicKey_t * entity_key, 00134 unsigned char * der_buffer, 00135 int * der_buffer_len ); 00136 00137 00138 #ifdef __cplusplus 00139 }; 00140 #endif 00141 00142 #endif