Certificates and key (assign, default)


Functions

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)
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)

Function Documentation

int CST_assign ( CST st,
const cst_t_seqnum  certID,
const cst_t_seqnum  keyID,
unsigned char *  password 
)

Assign private key with certificate

Parameters:
st Storage structure
certID Certificate
keyID Private key
password Password, need for test correct assign
Returns:
Error code
Possible error: CST_ERROR_ASSIGN_INCORRECT

X509* CST_default_cert ( CST st,
const char *  email 
)

Get default certificate by email

Parameters:
st Pointer to storage structure
email Email
Returns:
Defailt certificate or NULL

cst_t_seqnum CST_default_cert_id ( CST st,
const char *  email 
)

Get default certificate ID by email

Parameters:
st Pointer to storage structure
email Email
Returns:
certID for default certificate

cst_t_seqnum CST_get_assigned_key ( CST st,
const cst_t_seqnum  certID 
)

Get private key by his ID

Parameters:
st Pointer to storage structure
certID certID
Returns:
keyID or 0 if not found

EVP_PKEY* CST_get_priv_key ( CST st,
X509 *  cert,
unsigned char *  password 
)

Get private key by certificate

Parameters:
st Pointer to storage structure
cert Pointer to cert
password Password
Returns:
Private key or NULL if not found

EVP_PKEY* CST_get_priv_key_by_UID ( CST st,
X509_NAME *  issuer,
ASN1_INTEGER *  serial,
unsigned char *  password 
)

Get private key by certificate UID

Parameters:
st Pointer to storage structure
issuer Distinguished name of issuer
serial Serial number
password Password
Returns:
Private key or NULL if not found

EVP_PKEY* CST_get_priv_key_default ( CST st,
char *  email,
unsigned char *  password 
)

Get private key for default certificate

Parameters:
st Pointer to storage structure
email Email
password Password
Returns:
Private key or NULL

int CST_is_default ( CST st,
const cst_t_seqnum  certID 
)

Default or not certificate by UID

Parameters:
st Pointer to storage structure
certID Certificate id
Returns:
TRUE if default

int CST_set_default ( CST st,
const cst_t_seqnum  certID 
)

Set default certificate by unique ID (UID) (issuer + serial) for email of certificate.

Parameters:
st Pointer to storage structure
certID Certificate ID
Returns:
Error code or zero.
Possible errors: CST_ERROR_CERT_NOTFOUND - if certificate not found.


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