Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:00:00

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright (C) 2010 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  */
0020 
0021 #ifndef __G_TLS_CERTIFICATE_H__
0022 #define __G_TLS_CERTIFICATE_H__
0023 
0024 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0025 #error "Only <gio/gio.h> can be included directly."
0026 #endif
0027 
0028 #include <gio/giotypes.h>
0029 
0030 G_BEGIN_DECLS
0031 
0032 #define G_TYPE_TLS_CERTIFICATE            (g_tls_certificate_get_type ())
0033 #define G_TLS_CERTIFICATE(inst)           (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_CERTIFICATE, GTlsCertificate))
0034 #define G_TLS_CERTIFICATE_CLASS(class)    (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_CERTIFICATE, GTlsCertificateClass))
0035 #define G_IS_TLS_CERTIFICATE(inst)        (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_CERTIFICATE))
0036 #define G_IS_TLS_CERTIFICATE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_CERTIFICATE))
0037 #define G_TLS_CERTIFICATE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_CERTIFICATE, GTlsCertificateClass))
0038 
0039 typedef struct _GTlsCertificateClass   GTlsCertificateClass;
0040 typedef struct _GTlsCertificatePrivate GTlsCertificatePrivate;
0041 
0042 struct _GTlsCertificate {
0043   GObject parent_instance;
0044 
0045   GTlsCertificatePrivate *priv;
0046 };
0047 
0048 struct _GTlsCertificateClass
0049 {
0050   GObjectClass parent_class;
0051 
0052   GTlsCertificateFlags  (* verify) (GTlsCertificate     *cert,
0053                     GSocketConnectable  *identity,
0054                     GTlsCertificate     *trusted_ca);
0055 
0056   /*< private >*/
0057   /* Padding for future expansion */
0058   gpointer padding[8];
0059 };
0060 
0061 GIO_AVAILABLE_IN_ALL
0062 GType                 g_tls_certificate_get_type           (void) G_GNUC_CONST;
0063 
0064 GIO_AVAILABLE_IN_ALL
0065 GTlsCertificate      *g_tls_certificate_new_from_pem       (const gchar         *data,
0066                                 gssize               length,
0067                                 GError             **error);
0068 GIO_AVAILABLE_IN_2_72
0069 GTlsCertificate      *g_tls_certificate_new_from_pkcs12      (const guint8      *data,
0070                                                               gsize              length,
0071                                                               const gchar       *password,
0072                                                               GError           **error);
0073 GIO_AVAILABLE_IN_2_72
0074 GTlsCertificate      *g_tls_certificate_new_from_file_with_password (const gchar  *file,
0075                                                                      const gchar  *password,
0076                                                                      GError      **error);
0077 GIO_AVAILABLE_IN_ALL
0078 GTlsCertificate      *g_tls_certificate_new_from_file      (const gchar         *file,
0079                                 GError             **error);
0080 GIO_AVAILABLE_IN_ALL
0081 GTlsCertificate      *g_tls_certificate_new_from_files     (const gchar         *cert_file,
0082                                 const gchar         *key_file,
0083                                 GError             **error);
0084 GIO_AVAILABLE_IN_2_68
0085 GTlsCertificate      *g_tls_certificate_new_from_pkcs11_uris (const gchar       *pkcs11_uri,
0086                                                               const gchar       *private_key_pkcs11_uri,
0087                                                               GError           **error);
0088 
0089 GIO_AVAILABLE_IN_ALL
0090 GList                *g_tls_certificate_list_new_from_file (const gchar         *file,
0091                                 GError             **error);
0092 
0093 GIO_AVAILABLE_IN_ALL
0094 GTlsCertificate      *g_tls_certificate_get_issuer         (GTlsCertificate     *cert);
0095 
0096 GIO_AVAILABLE_IN_ALL
0097 GTlsCertificateFlags  g_tls_certificate_verify             (GTlsCertificate     *cert,
0098                                 GSocketConnectable  *identity,
0099                                 GTlsCertificate     *trusted_ca);
0100 
0101 GIO_AVAILABLE_IN_2_34
0102 gboolean              g_tls_certificate_is_same            (GTlsCertificate     *cert_one,
0103                                                             GTlsCertificate     *cert_two);
0104 
0105 GIO_AVAILABLE_IN_2_70
0106 GDateTime            *g_tls_certificate_get_not_valid_before (GTlsCertificate     *cert);
0107 
0108 GIO_AVAILABLE_IN_2_70
0109 GDateTime            *g_tls_certificate_get_not_valid_after  (GTlsCertificate     *cert);
0110 
0111 GIO_AVAILABLE_IN_2_70
0112 gchar                *g_tls_certificate_get_subject_name     (GTlsCertificate     *cert);
0113 
0114 GIO_AVAILABLE_IN_2_70
0115 gchar                *g_tls_certificate_get_issuer_name      (GTlsCertificate     *cert);
0116 
0117 GIO_AVAILABLE_IN_2_70
0118 GPtrArray            *g_tls_certificate_get_dns_names        (GTlsCertificate     *cert);
0119 
0120 GIO_AVAILABLE_IN_2_70
0121 GPtrArray            *g_tls_certificate_get_ip_addresses     (GTlsCertificate     *cert);
0122 
0123 G_END_DECLS
0124 
0125 #endif /* __G_TLS_CERTIFICATE_H__ */