@ -915,24 +915,6 @@ DYNAMIC_API PEP_STATUS get_identity(
pEp_identity * * identity
) ;
/**
* < ! - - replace_identities_fpr ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] old_fpr const char *
* @ param [ in ] new_fpr const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_CANNOT_SET_IDENTITY
* @ retval PEP_ILLEGAL_VALUE illegal parameter values
*
*/
PEP_STATUS replace_identities_fpr ( PEP_SESSION session ,
const char * old_fpr ,
const char * new_fpr ) ;
/**
* < ! - - set_identity ( ) - - >
@ -1196,45 +1178,6 @@ DYNAMIC_API PEP_STATUS import_key(
identity_list * * private_keys
) ;
/**
* < ! - - _import_key_with_fpr_return ( ) - - >
*
* @ brief INTERNAL FUNCTION - import keys from data , return optional list
* of fprs imported
*
* @ param [ in ] session session handle
* @ param [ in ] key_data key data , i . e . ASCII armored OpenPGP key
* @ param [ in ] size amount of data to handle
* @ param [ out ] private_keys list of identities containing the
* private keys that have been imported
* @ param [ out ] imported_keys if non - NULL , list of actual keys imported
* @ param [ out ] changed_public_keys if non - NULL AND imported_keys is non - NULL :
* bitvector - corresponds to the first 64 keys
* imported . If nth bit is set , import changed a
* key corresponding to the nth element in
* imported keys ( i . e . key was in DB and was
* changed by import )
*
* @ retval PEP_KEY_IMPORTED key was successfully imported
* @ retval PEP_OUT_OF_MEMORY out of memory
* @ retval PEP_ILLEGAL_VALUE there is no key data to import , or imported keys was NULL and
* changed_public_keys was not
*
* @ warning private_keys and imported_keys goes to the ownership of the caller
* private_keys and imported_keys can be left NULL , it is then ignored
* * * * THIS IS THE ACTUAL FUNCTION IMPLEMENTED BY CRYPTOTECH " import_key " * * *
*
*/
PEP_STATUS _import_key_with_fpr_return (
PEP_SESSION session ,
const char * key_data ,
size_t size ,
identity_list * * private_keys ,
stringlist_t * * imported_keys ,
uint64_t * changed_public_keys / / use as bit field for the first 64 changed keys
) ;
/**
* < ! - - export_key ( ) - - >
@ -1417,39 +1360,6 @@ DYNAMIC_API void *pEp_realloc(void *p, size_t size);
DYNAMIC_API PEP_STATUS get_trust ( PEP_SESSION session , pEp_identity * identity ) ;
/**
* < ! - - set_trust ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] identity pEp_identity *
*
* @ retval PEP_STATUS_OK
* @ retval any other value on error
*/
PEP_STATUS set_trust ( PEP_SESSION session ,
pEp_identity * identity ) ;
/**
* < ! - - update_trust_for_fpr ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] fpr const char *
* @ param [ in ] comm_type PEP_comm_type
*
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_TRUST
*
*/
PEP_STATUS update_trust_for_fpr ( PEP_SESSION session ,
const char * fpr ,
PEP_comm_type comm_type ) ;
/**
* < ! - - least_trust ( ) - - >
*
@ -1591,22 +1501,6 @@ DYNAMIC_API PEP_STATUS key_revoked(
bool * revoked
) ;
/**
* < ! - - get_key_userids ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] fpr const char *
* @ param [ in ] keylist stringlist_t * *
*
*/
PEP_STATUS get_key_userids (
PEP_SESSION session ,
const char * fpr ,
stringlist_t * * keylist
) ;
/**
* < ! - - get_crashdump_log ( ) - - >
@ -1763,46 +1657,6 @@ DYNAMIC_API PEP_STATUS get_revoked(
uint64_t * revocation_date
) ;
/**
* < ! - - key_created ( ) - - >
*
* @ brief Get creation date of a key
*
* @ param [ in ] session session handle
* @ param [ in ] fpr fingerprint of key
* @ param [ out ] created date of creation
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
*
*/
PEP_STATUS key_created (
PEP_SESSION session ,
const char * fpr ,
time_t * created
) ;
/**
* < ! - - find_private_keys ( ) - - >
*
* @ brief Find keys in keyring
*
* @ param [ in ] session session handle
* @ param [ in ] pattern fingerprint or address to search for as
* UTF - 8 string
* @ param [ out ] keylist list of fingerprints found or NULL on error
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
*
* @ warning the ownerships of keylist isgoing to the caller
* the caller must use free_stringlist ( ) to free it
*
*/
PEP_STATUS find_private_keys ( PEP_SESSION session , const char * pattern ,
stringlist_t * * keylist ) ;
/**
* < ! - - get_engine_version ( ) - - >
@ -1985,26 +1839,6 @@ DYNAMIC_API PEP_STATUS set_ident_enc_format(PEP_SESSION session,
PEP_enc_format format ) ;
/**
* < ! - - _generate_keypair ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] identity pEp_identity *
* @ param [ in ] suppress_event bool
*
* @ retval PEP_STATUS_OK encryption and signing succeeded
* @ retval PEP_ILLEGAL_VALUE illegal values for identity fields given
* @ retval PEP_CANNOT_CREATE_KEY key engine is on strike
* @ retval PEP_OUT_OF_MEMORY out of memory
* @ retval any other value on error
*
*/
PEP_STATUS _generate_keypair ( PEP_SESSION session ,
pEp_identity * identity ,
bool suppress_event ) ;
/**
* < ! - - reset_pEptest_hack ( ) - - >
*
@ -2020,194 +1854,6 @@ PEP_STATUS _generate_keypair(PEP_SESSION session,
*/
DYNAMIC_API PEP_STATUS reset_pEptest_hack ( PEP_SESSION session ) ;
/ / This is used internally when there is a temporary identity to be retrieved
/ / that may not yet have an FPR attached . See get_identity ( ) for functionality ,
/ / params and caveats .
/**
* < ! - - get_identity_without_trust_check ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] address const char *
* @ param [ in ] user_id const char *
* @ param [ in ] identity pEp_identity * *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_FIND_IDENTITY
* @ retval PEP_OUT_OF_MEMORY out of memory
*
*/
PEP_STATUS get_identity_without_trust_check (
PEP_SESSION session ,
const char * address ,
const char * user_id ,
pEp_identity * * identity
) ;
/**
* < ! - - get_identities_by_address ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] address const char *
* @ param [ in ] id_list identity_list * *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_FIND_IDENTITY
* @ retval PEP_OUT_OF_MEMORY out of memory
*
*/
PEP_STATUS get_identities_by_address (
PEP_SESSION session ,
const char * address ,
identity_list * * id_list
) ;
/**
* < ! - - get_identities_by_userid ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] user_id const char *
* @ param [ in ] identities identity_list * *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_FIND_IDENTITY
* @ retval PEP_OUT_OF_MEMORY out of memory
*
*/
PEP_STATUS get_identities_by_userid (
PEP_SESSION session ,
const char * user_id ,
identity_list * * identities
) ;
/**
* < ! - - is_own_address ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] address const char *
* @ param [ in ] is_own_addr bool *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_RECORD_NOT_FOUND
*
*/
PEP_STATUS is_own_address ( PEP_SESSION session ,
const char * address ,
bool * is_own_addr ) ;
/**
* < ! - - replace_userid ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] old_uid const char *
* @ param [ in ] new_uid const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_PERSON
*/
PEP_STATUS replace_userid ( PEP_SESSION session , const char * old_uid ,
const char * new_uid ) ;
/**
* < ! - - remove_key ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] fpr const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_PGP_KEYPAIR
*
*/
PEP_STATUS remove_key ( PEP_SESSION session , const char * fpr ) ;
/**
* < ! - - remove_fpr_as_default ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] fpr const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_IDENTITY
* @ retval PEP_CANNOT_SET_PERSON
*
*/
PEP_STATUS remove_fpr_as_default ( PEP_SESSION session ,
const char * fpr ) ;
/**
* < ! - - get_main_user_fpr ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] user_id const char *
* @ param [ in ] main_fpr char * *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_OUT_OF_MEMORY out of memory
* @ retval PEP_KEY_NOT_FOUND
* @ retval PEP_CANNOT_FIND_PERSON
*/
PEP_STATUS get_main_user_fpr ( PEP_SESSION session ,
const char * user_id ,
char * * main_fpr ) ;
/**
* < ! - - replace_main_user_fpr ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] user_id const char *
* @ param [ in ] new_fpr const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_PERSON
*
*/
PEP_STATUS replace_main_user_fpr ( PEP_SESSION session , const char * user_id ,
const char * new_fpr ) ;
/**
* < ! - - replace_main_user_fpr_if_equal ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] user_id const char *
* @ param [ in ] new_fpr const char *
* @ param [ in ] compare_fpr const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_PERSON
*
*/
PEP_STATUS replace_main_user_fpr_if_equal ( PEP_SESSION session , const char * user_id ,
const char * new_fpr , const char * compare_fpr ) ;
/**
* < ! - - get_replacement_fpr ( ) - - >
@ -2232,20 +1878,6 @@ DYNAMIC_API PEP_STATUS get_replacement_fpr(
uint64_t * revocation_date
) ;
/**
* < ! - - refresh_userid_default_key ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] user_id const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_PERSON
*
*/
PEP_STATUS refresh_userid_default_key ( PEP_SESSION session , const char * user_id ) ;
/ / This ONLY sets the * user * flag , and creates a shell identity if necessary .
/**
@ -2263,273 +1895,7 @@ PEP_STATUS refresh_userid_default_key(PEP_SESSION session, const char* user_id);
*/
DYNAMIC_API PEP_STATUS set_as_pEp_user ( PEP_SESSION session , pEp_identity * user ) ;
/ / returns true ( by reference ) if a person with this user_id exists ;
/ / Also replaces aliased user_ids by defaults in identity .
/**
* < ! - - exists_person ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] identity pEp_identity *
* @ param [ in ] exists bool *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_UNKNOWN_DB_ERROR
*/
PEP_STATUS exists_person ( PEP_SESSION session , pEp_identity * identity , bool * exists ) ;
/**
* < ! - - set_pgp_keypair ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] fpr const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_PGP_KEYPAIR
*/
PEP_STATUS set_pgp_keypair ( PEP_SESSION session , const char * fpr ) ;
/**
* < ! - - set_pEp_version ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] ident pEp_identity *
* @ param [ in ] new_ver_major unsigned int
* @ param [ in ] new_ver_minor unsigned int
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_PEP_VERSION
*
*/
PEP_STATUS set_pEp_version ( PEP_SESSION session , pEp_identity * ident , unsigned int new_ver_major , unsigned int new_ver_minor ) ;
/**
* < ! - - clear_trust_info ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] user_id const char *
* @ param [ in ] fpr const char *
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_UNKNOWN_ERROR
*
*/
PEP_STATUS clear_trust_info ( PEP_SESSION session ,
const char * user_id ,
const char * fpr ) ;
/ / Generally ONLY called by set_as_pEp_user , and ONLY from < 2.0 to 2.0 .
/**
* < ! - - upgrade_pEp_version_by_user_id ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] ident pEp_identity *
* @ param [ in ] new_ver_major unsigned int
* @ param [ in ] new_ver_minor unsigned int
*
* @ retval PEP_STATUS_OK
* @ retval PEP_ILLEGAL_VALUE illegal parameter value
* @ retval PEP_CANNOT_SET_PEP_VERSION
*
*/
PEP_STATUS upgrade_pEp_version_by_user_id ( PEP_SESSION session ,
pEp_identity * ident ,
unsigned int new_ver_major ,
unsigned int new_ver_minor
) ;
/ / exposed for testing
/**
* < ! - - set_person ( ) - - >
*
* @ brief TODO
*
* @ param [ in ] session session handle
* @ param [ in ] identity pEp_identity *
* @ param [ in ] guard_transaction bool
*
* @ retval PEP_STATUS_OK
* @ retval any other value on error
*/
PEP_STATUS set_person (