mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 11:54:22 -04:00
implemented export of identity (to create additional locations easily). Import still to do...
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5285 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2ca0bf71d0
commit
c9eb267165
11 changed files with 263 additions and 88 deletions
|
@ -514,6 +514,33 @@ ops_boolean_t ops_write_transferable_public_key_from_packet_data(const ops_keyda
|
|||
return rtn;
|
||||
}
|
||||
|
||||
ops_boolean_t ops_write_transferable_secret_key_from_packet_data(const ops_keydata_t *keydata,
|
||||
ops_boolean_t armoured,
|
||||
ops_create_info_t *info)
|
||||
{
|
||||
ops_boolean_t rtn = ops_true;
|
||||
unsigned int i=0,j=0;
|
||||
|
||||
if(keydata->type != OPS_PTAG_CT_ENCRYPTED_SECRET_KEY)
|
||||
{
|
||||
fprintf(stderr,"Can only output encrypted secret keys from raw packet data. Current type is %d\n",keydata->type) ;
|
||||
return ops_false ;
|
||||
}
|
||||
if (armoured)
|
||||
{ ops_writer_push_armoured(info, OPS_PGP_PRIVATE_KEY_BLOCK); }
|
||||
|
||||
for(i=0;i<keydata->npackets;++i)
|
||||
if(!ops_write(keydata->packets[i].raw, keydata->packets[i].length, info))
|
||||
return ops_false ;
|
||||
|
||||
if (armoured)
|
||||
{
|
||||
writer_info_finalise(&info->errors, &info->winfo);
|
||||
ops_writer_pop(info);
|
||||
}
|
||||
|
||||
return rtn;
|
||||
}
|
||||
/**
|
||||
\ingroup HighLevel_KeyWrite
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ ops_boolean_t ops_write_pk_session_key(ops_create_info_t *info,
|
|||
ops_boolean_t ops_write_transferable_public_key(const ops_keydata_t *key, ops_boolean_t armoured, ops_create_info_t *info);
|
||||
ops_boolean_t ops_write_transferable_secret_key(const ops_keydata_t *key, const unsigned char* passphrase, const size_t pplen, ops_boolean_t armoured, ops_create_info_t *info);
|
||||
ops_boolean_t ops_write_transferable_public_key_from_packet_data(const ops_keydata_t *keydata, ops_boolean_t armoured, ops_create_info_t *info);
|
||||
ops_boolean_t ops_write_transferable_secret_key_from_packet_data(const ops_keydata_t *keydata, ops_boolean_t armoured, ops_create_info_t *info);
|
||||
|
||||
|
||||
#endif /*OPS_CREATE_H*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue