GMimeSignature

GMimeSignature — Digital signatures

Synopsis

enum                GMimeSignatureStatus;
enum                GMimeSignatureError;
struct              GMimeSignature;
GMimeSignature *    g_mime_signature_new                (void);
GMimeCertificate *  g_mime_signature_get_certificate    (GMimeSignature *sig);
void                g_mime_signature_set_certificate    (GMimeSignature *sig,
                                                         GMimeCertificate *cert);
GMimeSignatureStatus g_mime_signature_get_status        (GMimeSignature *sig);
void                g_mime_signature_set_status         (GMimeSignature *sig,
                                                         GMimeSignatureStatus status);
GMimeSignatureError g_mime_signature_get_errors         (GMimeSignature *sig);
void                g_mime_signature_set_errors         (GMimeSignature *sig,
                                                         GMimeSignatureError errors);
time_t              g_mime_signature_get_created        (GMimeSignature *sig);
void                g_mime_signature_set_created        (GMimeSignature *sig,
                                                         time_t created);
time_t              g_mime_signature_get_expires        (GMimeSignature *sig);
void                g_mime_signature_set_expires        (GMimeSignature *sig,
                                                         time_t expires);

struct              GMimeSignatureList;
GMimeSignatureList * g_mime_signature_list_new          (void);
int                 g_mime_signature_list_length        (GMimeSignatureList *list);
void                g_mime_signature_list_clear         (GMimeSignatureList *list);
int                 g_mime_signature_list_add           (GMimeSignatureList *list,
                                                         GMimeSignature *sig);
void                g_mime_signature_list_insert        (GMimeSignatureList *list,
                                                         int index,
                                                         GMimeSignature *sig);
gboolean            g_mime_signature_list_remove        (GMimeSignatureList *list,
                                                         GMimeSignature *sig);
gboolean            g_mime_signature_list_remove_at     (GMimeSignatureList *list,
                                                         int index);
gboolean            g_mime_signature_list_contains      (GMimeSignatureList *list,
                                                         GMimeSignature *sig);
int                 g_mime_signature_list_index_of      (GMimeSignatureList *list,
                                                         GMimeSignature *sig);
GMimeSignature *    g_mime_signature_list_get_signature (GMimeSignatureList *list,
                                                         int index);
void                g_mime_signature_list_set_signature (GMimeSignatureList *list,
                                                         int index,
                                                         GMimeSignature *sig);

Object Hierarchy

  GObject
   +----GMimeSignature
  GObject
   +----GMimeSignatureList

Description

A GMimeSignature is an object containing useful information about a digital signature as used in signing and encrypting data.

Details

enum GMimeSignatureStatus

typedef enum {
	GMIME_SIGNATURE_STATUS_GOOD,
	GMIME_SIGNATURE_STATUS_ERROR,
	GMIME_SIGNATURE_STATUS_BAD
} GMimeSignatureStatus;

A value representing the signature status for a particular GMimeSignature.

GMIME_SIGNATURE_STATUS_GOOD

Good signature.

GMIME_SIGNATURE_STATUS_ERROR

An error occurred.

GMIME_SIGNATURE_STATUS_BAD

Bad signature.

enum GMimeSignatureError

typedef enum {
	GMIME_SIGNATURE_ERROR_NONE        = 0,
	GMIME_SIGNATURE_ERROR_EXPSIG      = (1 << 0),  /* expired signature */
	GMIME_SIGNATURE_ERROR_NO_PUBKEY   = (1 << 1),  /* no public key */
	GMIME_SIGNATURE_ERROR_EXPKEYSIG   = (1 << 2),  /* expired key */
	GMIME_SIGNATURE_ERROR_REVKEYSIG   = (1 << 3),  /* revoked key */
	GMIME_SIGNATURE_ERROR_UNSUPP_ALGO = (1 << 4)   /* unsupported algorithm */
} GMimeSignatureError;

Possible errors that a GMimeSignature could have.

GMIME_SIGNATURE_ERROR_NONE

No error.

GMIME_SIGNATURE_ERROR_EXPSIG

Expired signature.

GMIME_SIGNATURE_ERROR_NO_PUBKEY

No public key found.

GMIME_SIGNATURE_ERROR_EXPKEYSIG

Expired signature key.

GMIME_SIGNATURE_ERROR_REVKEYSIG

Revoked signature key.

GMIME_SIGNATURE_ERROR_UNSUPP_ALGO

Unsupported algorithm.

struct GMimeSignature

struct GMimeSignature;

An object containing useful information about a signature.


g_mime_signature_new ()

GMimeSignature *    g_mime_signature_new                (void);

Creates a new GMimeSignature object.

Returns :

a new GMimeSignature object.

g_mime_signature_get_certificate ()

GMimeCertificate *  g_mime_signature_get_certificate    (GMimeSignature *sig);

Get the signature's certificate.

sig :

a GMimeSignature

Returns :

the signature's certificate.

g_mime_signature_set_certificate ()

void                g_mime_signature_set_certificate    (GMimeSignature *sig,
                                                         GMimeCertificate *cert);

Set the signature's certificate.

sig :

a GMimeSignature

cert :

a GMimeCertificate

g_mime_signature_get_status ()

GMimeSignatureStatus g_mime_signature_get_status        (GMimeSignature *sig);

Get the signature status.

sig :

a GMimeSignature

Returns :

the signature status.

g_mime_signature_set_status ()

void                g_mime_signature_set_status         (GMimeSignature *sig,
                                                         GMimeSignatureStatus status);

Set the status on the signature.

sig :

a GMimeSignature

status :

a GMimeSignatureStatus

g_mime_signature_get_errors ()

GMimeSignatureError g_mime_signature_get_errors         (GMimeSignature *sig);

Get the signature errors. If the GMimeSignatureStatus returned from g_mime_signature_get_status() is not GMIME_SIGNATURE_STATUS_GOOD, then the errors may provide a clue as to why.

sig :

a GMimeSignature

Returns :

a bitfield of errors.

g_mime_signature_set_errors ()

void                g_mime_signature_set_errors         (GMimeSignature *sig,
                                                         GMimeSignatureError errors);

Set the errors on the signature.

sig :

a GMimeSignature

errors :

a GMimeSignatureError

g_mime_signature_get_created ()

time_t              g_mime_signature_get_created        (GMimeSignature *sig);

Get the creation date of the signature.

sig :

a GMimeSignature

Returns :

the creation date of the signature or -1 if unknown.

g_mime_signature_set_created ()

void                g_mime_signature_set_created        (GMimeSignature *sig,
                                                         time_t created);

Set the creation date of the signature.

sig :

a GMimeSignature

created :

creation date

g_mime_signature_get_expires ()

time_t              g_mime_signature_get_expires        (GMimeSignature *sig);

Get the expiration date of the signature.

sig :

a GMimeSignature

Returns :

the expiration date of the signature or -1 if unknown.

g_mime_signature_set_expires ()

void                g_mime_signature_set_expires        (GMimeSignature *sig,
                                                         time_t expires);

Set the expiration date of the signature.

sig :

a GMimeSignature

expires :

expiration date

struct GMimeSignatureList

struct GMimeSignatureList;

A collection of GMimeSignature objects.


g_mime_signature_list_new ()

GMimeSignatureList * g_mime_signature_list_new          (void);

Creates a new GMimeSignatureList.

Returns :

a new GMimeSignatureList.

g_mime_signature_list_length ()

int                 g_mime_signature_list_length        (GMimeSignatureList *list);

Gets the length of the list.

list :

a GMimeSignatureList

Returns :

the number of GMimeSignature objects in the list.

g_mime_signature_list_clear ()

void                g_mime_signature_list_clear         (GMimeSignatureList *list);

Clears the list of addresses.

list :

a GMimeSignatureList

g_mime_signature_list_add ()

int                 g_mime_signature_list_add           (GMimeSignatureList *list,
                                                         GMimeSignature *sig);

Adds a GMimeSignature to the GMimeSignatureList.

list :

a GMimeSignatureList

sig :

a GMimeSignature

Returns :

the index of the added GMimeSignature.

g_mime_signature_list_insert ()

void                g_mime_signature_list_insert        (GMimeSignatureList *list,
                                                         int index,
                                                         GMimeSignature *sig);

Inserts a GMimeSignature into the GMimeSignatureList at the specified index.

list :

a GMimeSignatureList

index :

index to insert at

sig :

a GMimeSignature

g_mime_signature_list_remove ()

gboolean            g_mime_signature_list_remove        (GMimeSignatureList *list,
                                                         GMimeSignature *sig);

Removes a GMimeSignature from the GMimeSignatureList.

list :

a GMimeSignatureList

sig :

a GMimeSignature

Returns :

TRUE if the specified GMimeSignature was removed or FALSE otherwise.

g_mime_signature_list_remove_at ()

gboolean            g_mime_signature_list_remove_at     (GMimeSignatureList *list,
                                                         int index);

Removes a GMimeSignature from the GMimeSignatureList at the specified index.

list :

a GMimeSignatureList

index :

index to remove

Returns :

TRUE if an GMimeSignature was removed or FALSE otherwise.

g_mime_signature_list_contains ()

gboolean            g_mime_signature_list_contains      (GMimeSignatureList *list,
                                                         GMimeSignature *sig);

Checks whether or not the specified GMimeSignature is contained within the GMimeSignatureList.

list :

a GMimeSignatureList

sig :

a GMimeSignature

Returns :

TRUE if the specified GMimeSignature is contained within the specified GMimeSignatureList or FALSE otherwise.

g_mime_signature_list_index_of ()

int                 g_mime_signature_list_index_of      (GMimeSignatureList *list,
                                                         GMimeSignature *sig);

Gets the index of the specified GMimeSignature inside the GMimeSignatureList.

list :

a GMimeSignatureList

sig :

a GMimeSignature

Returns :

the index of the requested GMimeSignature within the GMimeSignatureList or -1 if it is not contained within the GMimeSignatureList.

g_mime_signature_list_get_signature ()

GMimeSignature *    g_mime_signature_list_get_signature (GMimeSignatureList *list,
                                                         int index);

Gets the GMimeSignature at the specified index.

list :

a GMimeSignatureList

index :

index of GMimeSignature to get

Returns :

the GMimeSignature at the specified index or NULL if the index is out of range.

g_mime_signature_list_set_signature ()

void                g_mime_signature_list_set_signature (GMimeSignatureList *list,
                                                         int index,
                                                         GMimeSignature *sig);

Sets the GMimeSignature at the specified index to sig.

list :

a GMimeSignatureList

index :

index of GMimeSignature to set

sig :

a GMimeSignature