A certificate type. More...
#include <certificate.h>
Data Fields | |
gchar * | name |
Name of the certificate type ex: "x509", "pgp", etc. More... | |
gchar * | fullname |
User-friendly name for this type ex: N_("X.509 Certificates") When this is displayed anywhere, it should be i18ned ex: _(scheme->fullname) | |
PurpleCertificate *(* | import_certificate )(const gchar *filename) |
Imports a certificate from a file. More... | |
gboolean(* | export_certificate )(const gchar *filename, PurpleCertificate *crt) |
Exports a certificate to a file. More... | |
PurpleCertificate *(* | copy_certificate )(PurpleCertificate *crt) |
Duplicates a certificate. More... | |
void(* | destroy_certificate )(PurpleCertificate *crt) |
Destroys and frees a Certificate structure. More... | |
gboolean(* | signed_by )(PurpleCertificate *crt, PurpleCertificate *issuer) |
Find whether "crt" has a valid signature from issuer "issuer". More... | |
GByteArray *(* | get_fingerprint_sha1 )(PurpleCertificate *crt) |
Retrieves the certificate public key fingerprint using SHA1. More... | |
gchar *(* | get_unique_id )(PurpleCertificate *crt) |
Retrieves a unique certificate identifier. More... | |
gchar *(* | get_issuer_unique_id )(PurpleCertificate *crt) |
Retrieves a unique identifier for the certificate's issuer. More... | |
gchar *(* | get_subject_name )(PurpleCertificate *crt) |
Gets the certificate subject's name. More... | |
gboolean(* | check_subject_name )(PurpleCertificate *crt, const gchar *name) |
Check the subject name against that on the certificate. More... | |
gboolean(* | get_times )(PurpleCertificate *crt, time_t *activation, time_t *expiration) |
Retrieve the certificate activation/expiration times. | |
GSList *(* | import_certificates )(const gchar *filename) |
Imports certificates from a file. More... | |
void(* | _purple_reserved1 )(void) |
void(* | _purple_reserved2 )(void) |
void(* | _purple_reserved3 )(void) |
A certificate type.
A CertificateScheme must implement all of the fields in the structure, and register it using purple_certificate_register_scheme()
There may be only ONE CertificateScheme provided for each certificate type, as specified by the "name" field.
Definition at line 145 of file certificate.h.
gboolean(* _PurpleCertificateScheme::check_subject_name)(PurpleCertificate *crt, const gchar *name) |
Check the subject name against that on the certificate.
Definition at line 248 of file certificate.h.
PurpleCertificate*(* _PurpleCertificateScheme::copy_certificate)(PurpleCertificate *crt) |
Duplicates a certificate.
Certificates are generally assumed to be read-only, so feel free to do any sort of reference-counting magic you want here. If this ever changes, please remember to change the magic accordingly.
Definition at line 187 of file certificate.h.
void(* _PurpleCertificateScheme::destroy_certificate)(PurpleCertificate *crt) |
Destroys and frees a Certificate structure.
Destroys a Certificate's internal data structures and calls free(crt)
crt | Certificate instance to be destroyed. It WILL NOT be destroyed if it is not of the correct CertificateScheme. Can be NULL |
Definition at line 198 of file certificate.h.
gboolean(* _PurpleCertificateScheme::export_certificate)(const gchar *filename, PurpleCertificate *crt) |
Exports a certificate to a file.
filename | File to export the certificate to |
crt | Certificate to export |
Definition at line 177 of file certificate.h.
GByteArray*(* _PurpleCertificateScheme::get_fingerprint_sha1)(PurpleCertificate *crt) |
Retrieves the certificate public key fingerprint using SHA1.
crt | Certificate instance |
Definition at line 210 of file certificate.h.
gchar*(* _PurpleCertificateScheme::get_issuer_unique_id)(PurpleCertificate *crt) |
Retrieves a unique identifier for the certificate's issuer.
crt | Certificate instance |
Definition at line 228 of file certificate.h.
gchar*(* _PurpleCertificateScheme::get_subject_name)(PurpleCertificate *crt) |
Gets the certificate subject's name.
For X.509, this is the "Common Name" field, as we're only using it for hostname verification at the moment
crt | Certificate instance |
Definition at line 241 of file certificate.h.
gchar*(* _PurpleCertificateScheme::get_unique_id)(PurpleCertificate *crt) |
Retrieves a unique certificate identifier.
crt | Certificate instance |
Definition at line 219 of file certificate.h.
PurpleCertificate*(* _PurpleCertificateScheme::import_certificate)(const gchar *filename) |
Imports a certificate from a file.
filename | File to import the certificate from |
Definition at line 167 of file certificate.h.
GSList*(* _PurpleCertificateScheme::import_certificates)(const gchar *filename) |
Imports certificates from a file.
filename | File to import the certificates from |
Definition at line 259 of file certificate.h.
gchar* _PurpleCertificateScheme::name |
Name of the certificate type ex: "x509", "pgp", etc.
This must be globally unique - you may not register more than one CertificateScheme of the same name at a time.
Definition at line 152 of file certificate.h.
gboolean(* _PurpleCertificateScheme::signed_by)(PurpleCertificate *crt, PurpleCertificate *issuer) |
Find whether "crt" has a valid signature from issuer "issuer".
Definition at line 202 of file certificate.h.