------------------------------------------------------------
Open, close, save storage.
------------------------------------------------------------
Example:
// Open storage. Last two param now not used.
CST * st = CST_open_file("some.db", FALSE, NULL);

if (st != NULL)
{
    // If need, backup storage
    CST_backup("backup.db");

    // Some work (add cert, key...)

    // Save all changes 
    CST_save(st);

    // Free resources used by storage (not save changes!)
    CST_free(st);
}

------------------------------------------------------------
Certificate
------------------------------------------------------------
1. Folder 
    CA - used for check sign on certificates an CRL, all CA certificates must be here; 
    PRIVATE - users certificates; 
    OTHER - certificates of other people; 
    SITE - certificates of sites; 
    UNKNOWN - after import certificates by default placed here. 

For set and get folders use CST_set_folder() and CST_get_folder().

Example:
CST_set_folder(st, 231, CST_FOLDER_CA);
int folder = CST_get_folder(st, 231);

2. Purposes or trust settings.
    If you trust some CA certificate need set CST_PURPOSE_CA flag. 
If CST_PURPOSE_CA purpose not set for some CA certificate then function 
CST_is_valid() will be return FALSE for all certificates signed by this CA certificates.
    Other purposes you can use as you wish.
    Can be set more then one purposes.
    In future version storage will be check certificate for possible purposes.

Example:
// Set two flags
CST_set_purpose(st, 23, CST_PURPOSE_SMIME_SGN | CST_PURPOSE_SMIME_ENC, TRUE);
// Unset one flag
CST_set_purpose(st, 23, CST_PURPOSE_SMIME_ENC, FALSE);
// Check  
int res = CST_is_purpose(st, 23, CST_PURPOSE_SMIME_SGN);

3. Search function
Mainly, search function return GSList which contain integer ID of founded certificates.
After using return list you need free result: g_slist_free().

Example:
GSList * list = CST_search_by_folder(st, CST_FOLDER_CA);
GSList * i;
for (i = list; I != NULL; i = i->next)
{
  printf(certID = %u\n, GPOINTER_TO_UINT(i->data));
}
g_slist_free(list);

4. Check certificate
CST_is_expired(X509 * cert) - return TRUE if cert if today not between valid from and valid to 
CST_is_revoked(CST * st, X509 * cert) - return TRUE if found in some stored CRL 
CST_is_valid(CST * st, X509 * cert) - check validity of certificate using info form storage

5. X509 certificate by his ID
Example:
X509 * cert = CST_get_cert(st, 111);

6. Other properties of certificate
time_t CST_get_valid_from(X509 * cert);
time_t CST_get_valid_to(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);
