Tizen 2.0 Release
[external/libgnutls26.git] / libextra / openssl_compat.h
1 /*
2  * Copyright (C) 2002, 2003, 2004, 2005, 2008, 2010 Free Software
3  * Foundation, Inc.
4  *
5  * Author: Nikos Mavrogiannopoulos
6  *
7  * This file is part of GnuTLS-EXTRA.
8  *
9  * GnuTLS-extra is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 3 of the
12  * License, or (at your option) any later version.
13  *
14  * GnuTLS-extra is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with GnuTLS-EXTRA; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301, USA.
23  *
24  */
25
26 #ifndef GNUTLS_COMPAT8_H
27 #define GNUTLS_COMPAT8_H
28
29 /* Extra definitions */
30 #include <gnutls/openssl.h>
31
32 int gnutls_x509_extract_dn (const gnutls_datum_t *, gnutls_x509_dn *);
33 int gnutls_x509_extract_dn_string (const gnutls_datum_t * idn,
34                                    char *buf, unsigned int sizeof_buf);
35 int gnutls_x509_extract_certificate_dn (const gnutls_datum_t *,
36                                         gnutls_x509_dn *);
37 int gnutls_x509_extract_certificate_dn_string (char *buf,
38                                                unsigned int sizeof_buf,
39                                                const gnutls_datum_t * cert,
40                                                int issuer);
41 int gnutls_x509_extract_certificate_issuer_dn (const gnutls_datum_t *,
42                                                gnutls_x509_dn *);
43 int gnutls_x509_extract_certificate_version (const gnutls_datum_t *);
44 int gnutls_x509_extract_certificate_serial (const gnutls_datum_t * cert,
45                                             char *result, int *result_size);
46 time_t gnutls_x509_extract_certificate_activation_time (const gnutls_datum_t
47                                                         *);
48 time_t gnutls_x509_extract_certificate_expiration_time (const gnutls_datum_t
49                                                         *);
50 int gnutls_x509_extract_certificate_subject_alt_name (const gnutls_datum_t
51                                                       *, int seq, char *,
52                                                       int *);
53 int gnutls_x509_pkcs7_extract_certificate (const gnutls_datum_t *
54                                            pkcs7_struct, int indx,
55                                            char *certificate,
56                                            int *certificate_size);
57 int gnutls_x509_extract_certificate_pk_algorithm (const gnutls_datum_t *
58                                                   cert, int *bits);
59 int gnutls_x509_extract_certificate_ca_status (const gnutls_datum_t * cert);
60 int gnutls_x509_extract_key_pk_algorithm (const gnutls_datum_t * key);
61
62 int gnutls_x509_verify_certificate (const gnutls_datum_t * cert_list,
63                                     int cert_list_length,
64                                     const gnutls_datum_t * CA_list,
65                                     int CA_list_length,
66                                     const gnutls_datum_t * CRL_list,
67                                     int CRL_list_length);
68
69 #define gnutls_x509_fingerprint gnutls_fingerprint
70 #define gnutls_x509_certificate_format gnutls_x509_crt_fmt_t
71
72 #define gnutls_certificate_set_rsa_params gnutls_certificate_set_rsa_export_params
73
74 #endif