Private (public) key related


Functions

int CST_append_priv_key (CST *st, X509_NAME *account, EVP_PKEY *key, unsigned char *password)
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_priv_key_search_by_name (CST *st, X509_NAME *account)
GSList * CST_pub_key_search_by_name (CST *st, X509_NAME *account)
char * CST_EVP_PKEY_to_text (EVP_PKEY *key)
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)

Function Documentation

int CST_append_priv_key ( CST st,
X509_NAME *  account,
EVP_PKEY *  key,
unsigned char *  password 
)

Append private key to storage

Parameters:
st Pointer to storage structure
account Distinguished name for identify key
key Pointer to private key
password Password for key in storage
Returns:
Error code
Possible error: CST_ERROR_DBSTRUCTURE_CORRUPT, CST_ERROR_IO, CST_ERROR_NOSPC

int CST_append_pub_key ( CST st,
X509_NAME *  account,
EVP_PKEY *  key 
)

Append public key to storage

Parameters:
st Pointer to storage structure
account Distinguished name for identify key
key Pointer to public key
Returns:
Error code
Possible error: CST_ERROR_DBSTRUCTURE_CORRUPT, CST_ERROR_IO, CST_ERROR_NOSPC

int CST_delete_all_priv_key ( CST st,
X509_NAME *  account 
)

Delete all private key for account

Parameters:
st Pointer to storage structure
account Key for identify key
Returns:
Error code
Possible error: CST_ERROR_KEY_NOTFOUND - if account not found

int CST_delete_all_pub_key ( CST st,
X509_NAME *  account 
)

Delete all public key for account

Parameters:
st Pointer to storage structure
account Key for identify key
Returns:
Error code
Possible error: CST_ERROR_KEY_NOTFOUND - if account not found

int CST_delete_priv_key ( CST st,
const cst_t_seqnum  keyID 
)

Delete private key form storage

Parameters:
st Pointer to storage structure
keyID Private key ID
Returns:
Error code
Possible error: CST_ERROR_KEY_NOTFOUND

int CST_delete_pub_key ( CST st,
const cst_t_seqnum  keyID 
)

Delete public key form storage

Parameters:
st Pointer to storage structure
keyID Public key ID
Returns:
Error code
Possible error: CST_ERROR_KEY_NOTFOUND

char* CST_EVP_PKEY_to_text ( EVP_PKEY *  key  ) 

Convert key to text format

EVP_PKEY* CST_get_key ( CST st,
const cst_t_seqnum  keyID,
unsigned char *  password 
)

Get private EVP_PKEY by keyID

X509_NAME* CST_get_key_account ( CST st,
cst_t_seqnum  keyID 
)

Get account assigned with key

Parameters:
st Pointer to storage structure
keyID Key ID
Returns:
account assigned with key on append or import

EVP_PKEY* CST_get_pub_key ( CST st,
const cst_t_seqnum  keyID 
)

Get public key EVP_PKEY by keyID

GSList* CST_priv_key_search_by_name ( CST st,
X509_NAME *  account 
)

Get All private keys for given account

Parameters:
st Pointer to storage structure
account Account
Returns:
Array of keys or NULL if not found chain
Possible error: CST_ERROR_KEY_NOTFOUND - if cert chain incomplite

Example 2. Using search functions, which return GSList.

GSList* CST_pub_key_search_by_name ( CST st,
X509_NAME *  account 
)

Get All public keys for given account

Parameters:
st Pointer to storage structure
account Account
Returns:
Array of keys or NULL if not found chain
Possible error: CST_ERROR_KEY_NOTFOUND - if cert chain incomplite

Example 2. Using search functions, which return GSList.


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