Merged pidgin/main into default
[pidgin-git.git] / libpurple / tls-certificate-info.h
blobd0b21cb84607b268cfb248ef4f3a9231f31759ad
1 /*
3 * purple
5 * Purple is the legal property of its developers, whose names are too numerous
6 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * source distribution.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
24 #ifndef _PURPLE_TLS_CERTIFICATE_INFO_H
25 #define _PURPLE_TLS_CERTIFICATE_INFO_H
26 /**
27 * SECTION:tls-certificate-info
28 * @section_id: libpurple-tls-certificate-info
29 * @short_description: TLS certificate information parsing
30 * @title: TLS Certificate Info API
32 * The TLS certificate info API provides information parsing functions
33 * for #GTlsCertificate's. This information can then be presented to the
34 * user, usually to help them decide whether or not to trust a given
35 * certificate.
38 #include <gio/gio.h>
40 /**
41 * PurpleTlsCertificateInfo
43 * An opaque structure to contain parsed certificate info, which
44 * can subsequently be accessed by purple_tls_certificate_info_*
45 * functions.
47 typedef struct _PurpleTlsCertificateInfo PurpleTlsCertificateInfo;
49 #define PURPLE_TYPE_TLS_CERTIFICATE_INFO \
50 (purple_tls_certificate_info_get_type())
52 /**
53 * purple_tls_certificate_info_get_type:
55 * Returns: The #GType for the #PurpleTlsCertificateInfo boxed structure.
57 GType purple_tls_certificate_info_get_type(void);
59 /**
60 * purple_tls_certificate_get_info:
61 * @certificate: Certificate from which to parse the info
63 * Returns a #PurpleTlsCertificateInfo containing parsed information
64 * of the certificate.
66 * Returns: #PurpleTlsCertificateInfo parsed from the certificate
68 PurpleTlsCertificateInfo *
69 purple_tls_certificate_get_info(GTlsCertificate *certificate);
71 /**
72 * purple_tls_certificate_info_free:
73 * @info: #PurpleTlsCertificateInfo object to free
75 * Frees @info.
77 void
78 purple_tls_certificate_info_free(PurpleTlsCertificateInfo *info);
80 /**
81 * purple_tls_certificate_info_get_display_string:
82 * @info: #PurpleTlsCertificateInfo from which to generate a display string
84 * Generates a user readable string to display information from @info
86 * Returns: A user readable string suitable to display to the user
88 gchar *
89 purple_tls_certificate_info_get_display_string(PurpleTlsCertificateInfo *info);
91 /**
92 * purple_tls_certificate_get_subject_name:
93 * @certificate: Certificate from which to get the subject name
95 * Returns the common subject name of the cert
97 * Returns: The subject name of the cert
99 gchar *
100 purple_tls_certificate_info_get_subject_name(PurpleTlsCertificateInfo *info);
103 * purple_tls_certificate_get_fingerprint_sha1:
104 * @certificate: Certificate from which to get the SHA1 fingerprint
106 * Returns the SHA1 fingerprint of the cert
108 * Returns: (transfer full): The SHA1 fingerprint of the cert
110 GByteArray *
111 purple_tls_certificate_get_fingerprint_sha1(GTlsCertificate *certificate);
113 G_END_DECLS
115 #endif /* _PURPLE_TLS_CERTIFICATE_INFO_H */