cst.h File Reference

Go to the source code of this file.

Data Structures

struct  CST_st
 Cert, CRL ang key storage. More...

Defines

#define CST_DEBUG_LOCK
Error codes
#define CST_ERROR_OK   0
#define CST_ERROR_NOT_FOUND   1
#define CST_ERROR_STRUCTURE_CORRUPT   2
#define CST_ERROR_CREATE_FILE   3
#define CST_ERROR_CERT_EXIST   4
#define CST_ERROR_CRL_EXIST   6
#define CST_ERROR_STORAGE_IS_READONLY   7
#define CST_ERROR_KEY_NOTFOUND   8
#define CST_ERROR_CERT_NOTFOUND   9
#define CST_ERROR_NOT_IMPLEMENTED   10
#define CST_ERROR_NOT_INIT   11
#define CST_ERROR_UNDEF   12
#define CST_ERROR_PARAM_INCORRECT   13
#define CST_ERROR_NOT_OPEN   14
#define CST_ERROR_ASSIGN_INCORRECT   15
#define CST_ERROR_CRL_NOT_VALID   16
#define CST_ERROR_CHAIN_INCOMPLETE   17
#define CST_ERROR_CAPABILITY_NOTFOUND   18
#define CST_ERROR_INCORRECT_PURPOSE   19
#define CST_ERROR_IO   20
#define CST_ERROR_NOSPC   21
#define CST_ERROR_DBSTRUCTURE_CORRUPT   22
#define CST_ERROR_LOCK   23
#define CST_ERROR_PASSWORD_WRONG   24
#define CST_ERROR_BAD_INTERNAL_FORMAT   25
#define CST_ERROR_EXPORT   CST_ERROR_UNDEF
#define CST_ERROR_UNDEF_FILE_ERROR   CST_ERROR_UNDEF
#define CST_ERROR_CANCEL   30
Folders
#define CST_FOLDER_CA   1
 Certificate authority.
#define CST_FOLDER_PERSONAL   2
 Personal.
#define CST_FOLDER_OTHER   3
 Other.
#define CST_FOLDER_SITE   4
 Sites.
#define CST_FOLDER_UNKNOWN   0
 Unknown.
Purposes
#define CST_PURPOSE_NONE   0x0000
#define CST_PURPOSE_CA   0x0001
#define CST_PURPOSE_SMIME_SGN   0x0002
#define CST_PURPOSE_SMIME_ENC   0x0004
#define CST_PURPOSE_SSL_SERVER   0x0008
#define CST_PURPOSE_SSL_CLIENT   0x0010
#define CST_PURPOSE_SSL_WLAN   0x0020
#define CST_PURPOSE_CRL_SIGN   0x0040
#define CST_PURPOSE_ALL   0xFFFFFFFF
States
see function: CST_get_state()

#define CST_STATE_VALID   0x0001
#define CST_STATE_NOTVALID   0x0002
#define CST_STATE_EXPIRED   0x0004
#define CST_STATE_REVOKED   0x0008
Helper stack defines
#define CST_STACK_OF_X509   STACK_OF(X509)
#define CST_STACK_OF_CRL   STACK_OF(X509_CRL)
#define CST_STACK_OF_ASN1_OBJECT   STACK_OF(ASN1_OBJECT)

Typedefs

typedef guint cst_t_seqnum
 used for certID and keyID
typedef guint64 cst_t_mcount
 used for mcount
typedef CST_st CST
 Cert, CRL ang key storage.
typedef guint8 cst_t_cert_folder
 Certificate folders (8 bit).
typedef guint32 cst_t_cert_purpose
 Certificate purposes (32 bit).
typedef int(*) cst_pkcs12_confirm_cb (X509 *xcert, cst_t_cert_folder *folder, cst_t_cert_purpose *purpose, unsigned char **out_password, int is_pair, int *cancel, void *data)
typedef int(*) cst_pkcs12_error_cb (X509 *xcert, int error, void *data)

Functions

CSTCST_open (const int readonly, unsigned char *password)
 Open default storage.
CSTCST_open_file (const char *filename, const int readonly, unsigned char *password)
 Open local storage from file 'filename'. If file not exist then created.
int CST_create_file (const char *filename, unsigned char *password)
 Create empty local storage in file 'filename'.
int CST_save (CST *st)
void CST_free (CST *st)
int CST_last_error ()
int CST_backup (CST *st, const char *filename, unsigned char *password)
void CST_import_PKCS12 (CST *st, FILE *file, cst_pkcs12_confirm_cb confirm_cb, cst_pkcs12_error_cb error_cb, unsigned char *password, void *user_data, GError **error)
int CST_import_cert (CST *st, FILE *file, unsigned char *password)
int CST_import_cert_DER (CST *st, FILE *file)
int CST_import_cert_f (CST *st, FILE *file, unsigned char *password, const cst_t_cert_folder folder)
int CST_import_cert_f_DER (CST *st, FILE *file, const cst_t_cert_folder folder)
cst_t_seqnum CST_import_cert_adv (CST *st, FILE *file, const cst_t_cert_folder folder, GError **error)
cst_t_seqnum CST_import_cert_adv_DER (CST *st, FILE *file, const cst_t_cert_folder folder, GError **error)
int CST_export_all (CST *st, FILE *file, const cst_t_cert_folder folder)
int CST_export_all_DER (CST *st, FILE *file, const cst_t_cert_folder folder)
int CST_export_cert (CST *st, X509 *cert, FILE *file)
int CST_export_cert_DER (CST *st, X509 *cert, FILE *file)
int CST_export_cert_by_id (CST *st, const cst_t_seqnum certID, FILE *file)
int CST_export_cert_by_id_DER (CST *st, const cst_t_seqnum certID, FILE *file)
int CST_delete_cert (CST *st, const cst_t_seqnum certID)
int CST_append_X509 (CST *st, X509 *cert)
GSList * CST_append_sk_X509 (CST *st, CST_STACK_OF_X509 *list)
int CST_import_CRL (CST *st, FILE *file)
int CST_import_CRL_DER (CST *st, FILE *file)
GSList * CST_get_all_crl (CST *st)
int CST_delete_crl (CST *st, const cst_t_seqnum crlID)
X509_CRL * CST_get_CRL (CST *st, const cst_t_seqnum crlID)
int CST_import_priv_key (CST *st, X509_NAME *account, FILE *file, unsigned char *inpass, unsigned char *outpass)
int CST_import_priv_key_DER (CST *st, X509_NAME *account, FILE *file, unsigned char *outpass)
cst_t_seqnum CST_import_priv_key_adv (CST *st, X509_NAME *account, FILE *file, unsigned char *inpass, unsigned char *outpass, GError **error)
cst_t_seqnum CST_import_priv_key_adv_DER (CST *st, X509_NAME *account, FILE *file, unsigned char *outpass, GError **error)
int CST_export_priv_key (CST *st, EVP_PKEY *key, FILE *file, unsigned char *password)
int CST_export_priv_key_DER (CST *st, EVP_PKEY *key, FILE *file, unsigned char *password)
int CST_append_priv_key (CST *st, X509_NAME *account, EVP_PKEY *key, unsigned char *password)
int CST_import_pub_key (CST *st, X509_NAME *account, FILE *file)
int CST_import_pub_key_DER (CST *st, X509_NAME *account, FILE *file)
cst_t_seqnum CST_import_pub_key_adv (CST *st, X509_NAME *account, FILE *file, GError **error)
cst_t_seqnum CST_import_pub_key_adv_DER (CST *st, X509_NAME *account, FILE *file, GError **error)
int CST_export_all_pub_key (CST *st, X509_NAME *account, FILE *file)
int CST_export_all_pub_key_DER (CST *st, X509_NAME *account, FILE *file)
int CST_export_pub_key (CST *st, EVP_PKEY *key, FILE *file)
int CST_export_pub_key_DER (CST *st, EVP_PKEY *key, FILE *file)
int CST_append_pub_key (CST *st, X509_NAME *account, EVP_PKEY *key)
X509_NAME * CST_get_key_account (CST *st, cst_t_seqnum keyID)
int CST_delete_all_pub_key (CST *st, X509_NAME *account)
int CST_delete_all_priv_key (CST *st, X509_NAME *account)
int CST_delete_pub_key (CST *st, const cst_t_seqnum keyID)
int CST_delete_priv_key (CST *st, const cst_t_seqnum keyID)
GSList * CST_search_by_subj_name (CST *st, X509_NAME *subject_name)
GSList * CST_search_by_email (CST *st, const char *email)
GSList * CST_search_by_domain_name (CST *st, const char *domain_name)
GSList * CST_search_by_serial (CST *st, const char *serial)
GSList * CST_search_by_fingerprint (CST *st, const char *fingerprint)
cst_t_seqnum CST_search_issuer (CST *st, X509 *cert)
CST_STACK_OF_X509 * CST_get_chain (CST *st, X509 *cert)
GSList * CST_get_chain_id_by_id (CST *st, const cst_t_seqnum certID)
GSList * CST_get_chain_id (CST *st, X509 *x)
GSList * CST_search_by_folder_and_purpose (CST *st, const cst_t_cert_folder folder, const cst_t_cert_purpose purpose)
GSList * CST_search_by_folder (CST *st, const cst_t_cert_folder folder)
GSList * CST_priv_key_search_by_name (CST *st, X509_NAME *account)
GSList * CST_pub_key_search_by_name (CST *st, X509_NAME *account)
GSList * CST_all_expired (CST *st)
GSList * CST_all_revoked (CST *st)
GSList * CST_search_by_purpose (CST *st, const cst_t_cert_purpose purpose)
X509_NAME * CST_get_issued_by_dn (X509 *cert)
X509_NAME * CST_get_subject_dn (X509 *cert)
time_t CST_get_valid_from (X509 *cert)
time_t CST_get_valid_to (X509 *cert)
int CST_is_expired (X509 *cert)
ASN1_INTEGER * CST_get_serial_number (X509 *cert)
char * CST_get_serial_number_t (X509 *cert)
char * CST_get_fingerprint (X509 *cert)
char * CST_get_fingerprint_MD5 (X509 *cert)
char * CST_get_fingerprint_SHA1 (X509 *cert)
char * CST_get_email (X509 *cert)
char * CST_get_domain_name (X509 *cert)
char * CST_get_public_key_alg (X509 *cert)
int CST_check_purpose_x (X509 *x, const cst_t_cert_purpose purposes)
 Check purpose of X509.
int CST_check_purpose (CST *st, const cst_t_seqnum certID, const cst_t_cert_purpose purpose)
 Check purpose of certificate in storage by his ID.
int CST_is_root (X509 *cert)
int CST_is_root_id (CST *st, const cst_t_seqnum certID)
int CST_is_CA (X509 *cert)
char * CST_EVP_PKEY_to_text (EVP_PKEY *key)
int CST_is_revoked (CST *st, X509 *cert)
int CST_is_network (CST *st, X509 *cert)
char * CST_get_network_URL (CST *st, X509 *cert)
int CST_set_default (CST *st, const cst_t_seqnum certID)
X509 * CST_default_cert (CST *st, const char *email)
cst_t_seqnum CST_default_cert_id (CST *st, const char *email)
int CST_is_default (CST *st, const cst_t_seqnum certID)
cst_t_seqnum CST_search_by_UID (CST *st, X509_NAME *issuer, ASN1_INTEGER *serial)
cst_t_seqnum CST_search_by_X509 (CST *st, X509 *xcert)
int CST_assign (CST *st, const cst_t_seqnum certID, const cst_t_seqnum keyID, unsigned char *password)
EVP_PKEY * CST_get_priv_key_by_UID (CST *st, X509_NAME *issuer, ASN1_INTEGER *serial, unsigned char *password)
EVP_PKEY * CST_get_priv_key (CST *st, X509 *cert, unsigned char *password)
cst_t_seqnum CST_get_assigned_key (CST *st, const cst_t_seqnum certID)
EVP_PKEY * CST_get_priv_key_default (CST *st, char *email, unsigned char *password)
int CST_set_folder (CST *st, const cst_t_seqnum certID, const cst_t_cert_folder f)
cst_t_cert_folder CST_get_folder (CST *st, const cst_t_seqnum certID)
int CST_set_purpose (CST *st, const cst_t_seqnum certID, const cst_t_cert_purpose p, const int value)
int CST_is_purpose (CST *st, const cst_t_seqnum certID, const cst_t_cert_purpose p)
int CST_is_valid (CST *st, X509 *cert)
int CST_is_valid_f (CST *st, FILE *file, GError **error)
int CST_is_valid_f_DER (CST *st, FILE *file, GError **error)
int CST_is_valid_for (CST *st, X509 *cert, const cst_t_cert_purpose purpose)
int CST_set_capability (CST *st, const cst_t_seqnum certID, ASN1_OBJECT *oid, unsigned char *data, int data_length)
unsigned char * CST_get_capability_data (CST *st, const cst_t_seqnum certID, ASN1_OBJECT *oid, int *data_length)
CST_STACK_OF_ASN1_OBJECT * CST_get_capabilities (CST *st, const cst_t_seqnum certID)
int CST_is_capability (CST *st, const cst_t_seqnum certID, ASN1_OBJECT *oid)
int CST_delete_capability (CST *st, const cst_t_seqnum certID, ASN1_OBJECT *oid)
int CST_get_state (CST *st, X509 *cert)
 Get state of certificate.
X509 * CST_get_cert (CST *st, const cst_t_seqnum certID)
EVP_PKEY * CST_get_key (CST *st, const cst_t_seqnum keyID, unsigned char *password)
EVP_PKEY * CST_get_pub_key (CST *st, const cst_t_seqnum keyID)
CST_STACK_OF_X509 * CST_all_CA ()


Detailed Description

Certificate storage API

Typedef Documentation

typedef guint8 cst_t_cert_folder

Certificate folders (8 bit).

see: cst_const.h

typedef guint32 cst_t_cert_purpose

Certificate purposes (32 bit).

see: cst_const.h

typedef guint64 cst_t_mcount

used for mcount

see: cst_const.h

typedef guint cst_t_seqnum

used for certID and keyID

see: cst_const.h


Function Documentation

CST_STACK_OF_X509* CST_all_CA (  ) 

Get all CA


Generated on Fri Sep 28 12:57:35 2007 for Certman by  doxygen 1.5.1