_PurpleCertificateScheme Struct Reference

A certificate type. More...

#include <certificate.h>


Data Fields

gchar * name
 Name of the certificate type ex: "x509", "pgp", etc.
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.
gboolean(* export_certificate )(const gchar *filename, PurpleCertificate *crt)
 Exports a certificate to a file.
PurpleCertificate *(* copy_certificate )(PurpleCertificate *crt)
 Duplicates a certificate.
void(* destroy_certificate )(PurpleCertificate *crt)
 Destroys and frees a Certificate structure.
gboolean(* signed_by )(PurpleCertificate *crt, PurpleCertificate *issuer)
 Find whether "crt" has a valid signature from issuer "issuer".
GByteArray *(* get_fingerprint_sha1 )(PurpleCertificate *crt)
 Retrieves the certificate public key fingerprint using SHA1.
gchar *(* get_unique_id )(PurpleCertificate *crt)
 Retrieves a unique certificate identifier.
gchar *(* get_issuer_unique_id )(PurpleCertificate *crt)
 Retrieves a unique identifier for the certificate's issuer.
gchar *(* get_subject_name )(PurpleCertificate *crt)
 Gets the certificate subject's name.
gboolean(* check_subject_name )(PurpleCertificate *crt, const gchar *name)
 Check the subject name against that on the certificate.
gboolean(* get_times )(PurpleCertificate *crt, time_t *activation, time_t *expiration)
 Retrieve the certificate activation/expiration times.
void(* _purple_reserved1 )(void)
void(* _purple_reserved2 )(void)
void(* _purple_reserved3 )(void)
void(* _purple_reserved4 )(void)


Detailed Description

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.


Field Documentation

Check the subject name against that on the certificate.

See also:
purple_certificate_check_subject_name()
Returns:
TRUE if it is a match, else FALSE

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.

Returns:
Reference to the new copy

Destroys and frees a Certificate structure.

Destroys a Certificate's internal data structures and calls free(crt)

Parameters:
crt Certificate instance to be destroyed. It WILL NOT be destroyed if it is not of the correct CertificateScheme. Can be NULL

gboolean(* _PurpleCertificateScheme::export_certificate)(const gchar *filename, PurpleCertificate *crt)

Exports a certificate to a file.

Parameters:
filename File to export the certificate to
crt Certificate to export
Returns:
TRUE if the export succeeded, otherwise FALSE
See also:
purple_certificate_export()

Retrieves the certificate public key fingerprint using SHA1.

Parameters:
crt Certificate instance
Returns:
Binary representation of SHA1 hash - must be freed using g_byte_array_free()

Retrieves a unique identifier for the certificate's issuer.

Parameters:
crt Certificate instance
Returns:
Newly allocated string that can be used to uniquely identify the issuer's certificate.

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

See also:
purple_certificate_get_subject_name()
Parameters:
crt Certificate instance
Returns:
Newly allocated string with the certificate subject.

Retrieves a unique certificate identifier.

Parameters:
crt Certificate instance
Returns:
Newly allocated string that can be used to uniquely identify the certificate.

Imports a certificate from a file.

Parameters:
filename File to import the certificate from
Returns:
Pointer to the newly allocated Certificate struct or NULL on failure.

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.

Find whether "crt" has a valid signature from issuer "issuer".

See also:
purple_certificate_signed_by()


The documentation for this struct was generated from the following file: