|
OpenVAS Libraries
4.0+rc3.SVN
|
#include <fcntl.h>#include <unistd.h>#include "certificate.h"#include "openvas_certificate_file.h"Macros | |
| #define | KEY_CERT_OWNERNAME "ownername" |
| #define | KEY_CERT_TRUSTED "trusted" |
| #define | _(abc) abc |
Functions | |
| gboolean | openvas_certificate_file_write (GHashTable *certs, char *filename) |
| Writes all certificates found in certs. | |
| GHashTable * | openvas_certificate_file_read (char *filename) |
| Reads all certificates found in file filename, creates. | |
Functions to "(de)serialize" one or more certificates to or from a file. The public key will neither be stored nor loaded. Makes use of GLibs GKeyFile mechanism. The files will and have to look like:
[C3B468D2288C68B9D526452248479FF648DB4530] ownername= Transfer Integrity trusted=false
where there can be more than one entry as shown above. This follows a freeddesktop.org specification and is parsed using GLibs GKeyFile.
| #define _ | ( | abc | ) | abc |
| #define KEY_CERT_OWNERNAME "ownername" |
Key used to store ownernames.
| #define KEY_CERT_TRUSTED "trusted" |
Key used to store trust level.
| GHashTable* openvas_certificate_file_read | ( | char * | filename | ) |
Reads all certificates found in file filename, creates.
certificate_t structs, stores these in a GHashTable (with fingerprints as keys) and returns the hashtable.
Certificates can be written to that file calling openvas_certificate_file_write.
| filename | Path to file to read certificates from. |
| gboolean openvas_certificate_file_write | ( | GHashTable * | certs, |
| char * | filename | ||
| ) |
Writes all certificates found in certs.
(might be NULL) to the file filename.
Certificates can be retrieved from that file calling openvas_certificate_file_read.
| context | Context of which the certificates shall be stored. |
| filename | Filename used to save the certificates. |
1.8.1.1