Certificate header file.
More...
#include <glib.h>
Go to the source code of this file.
|
| certificate_t * | certificate_create (void) |
| | Create a new, empty certificate structure. More...
|
| |
| certificate_t * | certificate_create_full (const char *fingerprint, const char *owner, const char *public_key, gboolean trusted) |
| | Create a new certificate structure wih all values set. More...
|
| |
| void | certificate_free (certificate_t *) |
| | Free memory of a certificate structure. More...
|
| |
| const gchar * | certificate_fingerprint (const certificate_t *) |
| | Get the fingerprint of a certificate. More...
|
| |
| const gchar * | certificate_owner (const certificate_t *) |
| | Get the owner of a certificate. More...
|
| |
| const gchar * | certificate_public_key (const certificate_t *) |
| | Get the public key of a certificate. More...
|
| |
| gboolean | certificate_trusted (const certificate_t *) |
| | Get the trustedness of a certificate. More...
|
| |
| const gchar * | certificate_trust_level (const certificate_t *) |
| |
| int | certificate_set_fingerprint (certificate_t *, const gchar *) |
| | Set the fingerprint of a certificate. More...
|
| |
| int | certificate_set_owner (certificate_t *, const gchar *) |
| | Set the owner of a certificate. More...
|
| |
| int | certificate_set_public_key (certificate_t *, const gchar *) |
| | Set the public key of a certificate. More...
|
| |
| void | certificate_set_trusted (certificate_t *, gboolean) |
| | Set the trustedness of a certificate. More...
|
| |
| certificates_t * | certificates_create () |
| | Make a collection of certificates. More...
|
| |
| void | certificates_free (certificates_t *) |
| | Free a collection of certificates. More...
|
| |
| guint | certificates_size (certificates_t *) |
| | Get the size of a collection of certificates. More...
|
| |
| void | certificates_add (certificates_t *, certificate_t *) |
| | Add a certificate to a collection of certificate. More...
|
| |
| certificate_t * | certificates_find (certificates_t *certificates, gconstpointer data, GCompareFunc function) |
| | Search the certificates with a function. More...
|
| |
Create a new, empty certificate structure.
- Todo:
- Correct doc or implementation for the set_* methods, they always return 0.
- Returns
- NULL in case the memory could not be allocated. Else an empty certificate structure which needs to be released using certificate_free .
| certificate_t* certificate_create_full |
( |
const char * |
fingerprint, |
|
|
const char * |
owner, |
|
|
const char * |
public_key, |
|
|
gboolean |
trusted |
|
) |
| |
Create a new certificate structure wih all values set.
- Parameters
-
| fingerprint | Fingerprint of the certificate. |
| owner | Name of the owner of the certificate. |
| public_key | Full public key of the certificate. |
| trusted | Whether or not this certificate is trustworthy. |
- Returns
- NULL in case the memory could not be allocated. Else a filled certificate structure which owns its values and needs to be released using certificate_free .
| const gchar* certificate_fingerprint |
( |
const certificate_t * |
certificate) | |
|
Get the fingerprint of a certificate.
- Parameters
-
| certificate | The certificate. |
- Returns
- The fingerprint, which may be NULL.
Free memory of a certificate structure.
- Parameters
-
| n | The structure to be freed. |
| const gchar* certificate_owner |
( |
const certificate_t * |
certificate) | |
|
Get the owner of a certificate.
- Parameters
-
| certificate | The certificate. |
- Returns
- The owner, which may be NULL.
| const gchar* certificate_public_key |
( |
const certificate_t * |
certificate) | |
|
Get the public key of a certificate.
- Parameters
-
| certificate | The certificate. |
- Returns
- The public key, which may be NULL.
| int certificate_set_fingerprint |
( |
certificate_t * |
certificate, |
|
|
const gchar * |
fingerprint |
|
) |
| |
Set the fingerprint of a certificate.
- Parameters
-
| certificate | The certificate. |
| fingerprint | The fingerprint. |
- Returns
- 0 on success, -1 on error.
| int certificate_set_owner |
( |
certificate_t * |
certificate, |
|
|
const gchar * |
owner |
|
) |
| |
Set the owner of a certificate.
- Parameters
-
| certificate | The certificate. |
| owner | The owner. |
- Returns
- 0 on success, -1 on error.
| int certificate_set_public_key |
( |
certificate_t * |
certificate, |
|
|
const gchar * |
public_key |
|
) |
| |
Set the public key of a certificate.
- Parameters
-
| certificate | The certificate. |
| public | key The public key. |
- Returns
- 0 on success, -1 on error.
| void certificate_set_trusted |
( |
certificate_t * |
certificate, |
|
|
gboolean |
trusted |
|
) |
| |
Set the trustedness of a certificate.
- Parameters
-
| certificate | The certificate. |
| trusted | TRUE if trusted, else FALSE. |
| gboolean certificate_trusted |
( |
const certificate_t * |
certificate) | |
|
Get the trustedness of a certificate.
- Parameters
-
| certificate | The certificate. |
- Returns
- TRUE if the key is trusted, else FALSE.
Add a certificate to a collection of certificate.
- Parameters
-
| certificates | The collection of certificates. |
Make a collection of certificates.
- Returns
- A new collection of certificates or NULL on error.
Search the certificates with a function.
- Parameters
-
| certificates | Certificates to search. |
| data | First argument to function. |
| function | Comparison function. |
- Returns
- The first element for which the comparison function function returns 0.
Free a collection of certificates.
- Parameters
-
| certificates | The collection of certificates. |
Get the size of a collection of certificates.
- Returns
- The number of entries in the collection.