Qpid Proton C API  0.17.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ssl.h
Go to the documentation of this file.
1 #ifndef PROTON_SSL_H
2 #define PROTON_SSL_H 1
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include <proton/import_export.h>
26 #include <proton/type_compat.h>
27 #include <proton/types.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
81 
85 typedef struct pn_ssl_t pn_ssl_t;
86 
90 typedef enum {
94 
98 typedef enum {
103 
109 PN_EXTERN bool pn_ssl_present( void );
110 
123 
130 PN_EXTERN void pn_ssl_domain_free(pn_ssl_domain_t *domain);
131 
156 PN_EXTERN int pn_ssl_domain_set_credentials(pn_ssl_domain_t *domain,
157  const char *credential_1,
158  const char *credential_2,
159  const char *password);
160 
177  const char *certificate_db);
178 
195 typedef enum {
201 
226  const pn_ssl_verify_mode_t mode,
227  const char *trusted_CAs);
228 
240 
251 PN_EXTERN pn_ssl_t *pn_ssl(pn_transport_t *transport);
252 
267 PN_EXTERN int pn_ssl_init(pn_ssl_t *ssl,
268  pn_ssl_domain_t *domain,
269  const char *session_id);
270 
284 PN_EXTERN bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *buffer, size_t size);
285 
292 PN_EXTERN int pn_ssl_get_ssf(pn_ssl_t *ssl);
293 
306 PN_EXTERN bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *buffer, size_t size);
307 
322 
345 PN_EXTERN int pn_ssl_set_peer_hostname(pn_ssl_t *ssl, const char *hostname);
346 
360 PN_EXTERN int pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *hostname, size_t *bufsize);
361 
369 PN_EXTERN const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl);
370 
374 typedef enum {
375  PN_SSL_CERT_SUBJECT_COUNTRY_NAME,
376  PN_SSL_CERT_SUBJECT_STATE_OR_PROVINCE,
377  PN_SSL_CERT_SUBJECT_CITY_OR_LOCALITY,
378  PN_SSL_CERT_SUBJECT_ORGANIZATION_NAME,
379  PN_SSL_CERT_SUBJECT_ORGANIZATION_UNIT,
380  PN_SSL_CERT_SUBJECT_COMMON_NAME
382 
386 typedef enum {
387  PN_SSL_SHA1, /* Produces hash that is 20 bytes long */
388  PN_SSL_SHA256, /* Produces hash that is 32 bytes long */
389  PN_SSL_SHA512, /* Produces hash that is 64 bytes long */
390  PN_SSL_MD5 /* Produces hash that is 16 bytes long */
392 
406 PN_EXTERN int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0,
407  char *fingerprint,
408  size_t fingerprint_length,
409  pn_ssl_hash_alg hash_alg);
410 
424 
429 #ifdef __cplusplus
430 }
431 #endif
432 
433 #endif /* ssl.h */