2014-02-20 20:09:24 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=9" / >
< title > libpcp: KEYS< / title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "dynsections.js" > < / script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td style = "padding-left: 0.5em;" >
< div id = "projectname" > libpcp
  < span id = "projectnumber" > 0.2.1< / span >
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
< div id = "navrow1" class = "tabs" >
< ul class = "tablist" >
< li > < a href = "index.html" > < span > Main  Page< / span > < / a > < / li >
< li > < a href = "modules.html" > < span > Modules< / span > < / a > < / li >
< li > < a href = "annotated.html" > < span > Classes< / span > < / a > < / li >
< li > < a href = "files.html" > < span > Files< / span > < / a > < / li >
< / ul >
< / div >
< / div > <!-- top -->
< div class = "header" >
< div class = "summary" >
< a href = "#nested-classes" > Classes< / a > |
< a href = "#typedef-members" > Typedefs< / a > |
< a href = "#enum-members" > Enumerations< / a > |
< a href = "#func-members" > Functions< / a > < / div >
< div class = "headertitle" >
< div class = "title" > KEYS< / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< p > PCP public and secret key functions.
< a href = "#details" > More...< / a > < / p >
< table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "nested-classes" > < / a >
Classes< / h2 > < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > struct   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "struct__pcp__key__t.html" > _pcp_key_t< / a > < / td > < / tr >
< tr class = "memdesc:" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > PCP private key structure. < a href = "struct__pcp__key__t.html#details" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > struct   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "struct__pcp__pubkey__t.html" > _pcp_pubkey_t< / a > < / td > < / tr >
< tr class = "memdesc:" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > PCP public key structure. < a href = "struct__pcp__pubkey__t.html#details" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > struct   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "struct__pcp__rec__t.html" > _pcp_rec_t< / a > < / td > < / tr >
< tr class = "memdesc:" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Encrypted recipient list. < a href = "struct__pcp__rec__t.html#details" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "typedef-members" > < / a >
Typedefs< / h2 > < / td > < / tr >
< tr class = "memitem:gae88eb39995125f3b68b4ce9175b41732" > < td class = "memItemLeft" align = "right" valign = "top" > typedef struct < a class = "el" href = "struct__pcp__key__t.html" > _pcp_key_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > < / td > < / tr >
< tr class = "memdesc:gae88eb39995125f3b68b4ce9175b41732" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Typedef for secret keys. < a href = "#gae88eb39995125f3b68b4ce9175b41732" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gae88eb39995125f3b68b4ce9175b41732" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga859c793ca80717fdfc8ebef3e7224746" > < td class = "memItemLeft" align = "right" valign = "top" > typedef struct < a class = "el" href = "struct__pcp__pubkey__t.html" > _pcp_pubkey_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > < / td > < / tr >
< tr class = "memdesc:ga859c793ca80717fdfc8ebef3e7224746" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Typedef for public keys. < a href = "#ga859c793ca80717fdfc8ebef3e7224746" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga859c793ca80717fdfc8ebef3e7224746" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gab69d94a862952b046c6f340d3c701dd0" > < td class = "memItemLeft" align = "right" valign = "top" > typedef struct < a class = "el" href = "struct__pcp__rec__t.html" > _pcp_rec_t< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gab69d94a862952b046c6f340d3c701dd0" > pcp_rec_t< / a > < / td > < / tr >
< tr class = "memdesc:gab69d94a862952b046c6f340d3c701dd0" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Typedef for public keys. < a href = "#gab69d94a862952b046c6f340d3c701dd0" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gab69d94a862952b046c6f340d3c701dd0" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "enum-members" > < / a >
Enumerations< / h2 > < / td > < / tr >
< tr class = "memitem:ga19da9fe7a497dcd854feff4d29e4472d" > < td class = "memItemLeft" align = "right" valign = "top" > enum   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga19da9fe7a497dcd854feff4d29e4472d" > _PCP_KEY_TYPES< / a > { < br / >
    < a class = "el" href = "group__KEYS.html#gga19da9fe7a497dcd854feff4d29e4472da2cbd93780b8b12601c8243317f712b99" > PCP_KEY_TYPE_MAINSECRET< / a > = 1,
< a class = "el" href = "group__KEYS.html#gga19da9fe7a497dcd854feff4d29e4472da719ee3955ec3f9031d77f12759e75e62" > PCP_KEY_TYPE_SECRET< / a > = 2,
< a class = "el" href = "group__KEYS.html#gga19da9fe7a497dcd854feff4d29e4472da4ec09a5121dc8a4ebe8a9991058ed0f0" > PCP_KEY_TYPE_PUBLIC< / a > = 3,
< a class = "el" href = "group__KEYS.html#gga19da9fe7a497dcd854feff4d29e4472da416d3698781131f927f2fa0eaef32490" > PCP_KEYSIG_NATIVE< / a > = 4,
< br / >
    < a class = "el" href = "group__KEYS.html#gga19da9fe7a497dcd854feff4d29e4472da1e1cd206d3b6397ae6e67c479956308b" > PCP_KEYSIG_PBP< / a > = 5
< br / >
}< / td > < / tr >
< tr class = "memdesc:ga19da9fe7a497dcd854feff4d29e4472d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Internal key types. < a href = "group__KEYS.html#ga19da9fe7a497dcd854feff4d29e4472d" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:ga19da9fe7a497dcd854feff4d29e4472d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "func-members" > < / a >
Functions< / h2 > < / td > < / tr >
< tr class = "memitem:gaecf6a1829b4133350a7cb694c3eca8ad" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gaecf6a1829b4133350a7cb694c3eca8ad" > pcpkey_new< / a > ()< / td > < / tr >
< tr class = "memdesc:gaecf6a1829b4133350a7cb694c3eca8ad" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate a new key structure. < a href = "#gaecf6a1829b4133350a7cb694c3eca8ad" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gaecf6a1829b4133350a7cb694c3eca8ad" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gabdc09d45ad7a6f9f039f9240635a743f" > < td class = "memItemLeft" align = "right" valign = "top" > char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gabdc09d45ad7a6f9f039f9240635a743f" > pcppubkey_get_art< / a > (< a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *k)< / td > < / tr >
< tr class = "memdesc:gabdc09d45ad7a6f9f039f9240635a743f" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate an ASCII art image of the public key. < a href = "#gabdc09d45ad7a6f9f039f9240635a743f" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gabdc09d45ad7a6f9f039f9240635a743f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga13aae5cf5986e308f1af674bedf0e6fd" > < td class = "memItemLeft" align = "right" valign = "top" > char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga13aae5cf5986e308f1af674bedf0e6fd" > pcpkey_get_art< / a > (< a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *k)< / td > < / tr >
< tr class = "memdesc:ga13aae5cf5986e308f1af674bedf0e6fd" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate an ASCII art image of the public key part of a secret key. < a href = "#ga13aae5cf5986e308f1af674bedf0e6fd" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga13aae5cf5986e308f1af674bedf0e6fd" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga30c2d289b43fe80562fc74068f2566ae" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga30c2d289b43fe80562fc74068f2566ae" > pcpkey_encrypt< / a > (< a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *key, char *passphrase)< / td > < / tr >
< tr class = "memdesc:ga30c2d289b43fe80562fc74068f2566ae" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Encrypt a secret key structure. < a href = "#ga30c2d289b43fe80562fc74068f2566ae" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga30c2d289b43fe80562fc74068f2566ae" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gad91934413b36cfe316458c90ceb1eb99" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gad91934413b36cfe316458c90ceb1eb99" > pcpkey_decrypt< / a > (< a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *key, char *passphrase)< / td > < / tr >
< tr class = "memdesc:gad91934413b36cfe316458c90ceb1eb99" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Decrypt a secret key structure. < a href = "#gad91934413b36cfe316458c90ceb1eb99" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gad91934413b36cfe316458c90ceb1eb99" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga22c965c007208e860deaa4c145046283" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga22c965c007208e860deaa4c145046283" > pcpkey_pub_from_secret< / a > (< a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *key)< / td > < / tr >
< tr class = "memdesc:ga22c965c007208e860deaa4c145046283" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate a public key structure from a given secret key structure. < a href = "#ga22c965c007208e860deaa4c145046283" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga22c965c007208e860deaa4c145046283" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gaac64db4cd21af0cf79512ea0ea43261f" > < td class = "memItemLeft" align = "right" valign = "top" > char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gaac64db4cd21af0cf79512ea0ea43261f" > pcp_getkeyid< / a > (< a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *k)< / td > < / tr >
< tr class = "memdesc:gaac64db4cd21af0cf79512ea0ea43261f" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Calculate a key-id from public key fields. < a href = "#gaac64db4cd21af0cf79512ea0ea43261f" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gaac64db4cd21af0cf79512ea0ea43261f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gab16e85cdb769465c8ce8808b581c7a3d" > < td class = "memItemLeft" align = "right" valign = "top" > char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gab16e85cdb769465c8ce8808b581c7a3d" > pcp_getpubkeyid< / a > (< a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *k)< / td > < / tr >
< tr class = "memdesc:gab16e85cdb769465c8ce8808b581c7a3d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Calculate a key-id from public key fields. < a href = "#gab16e85cdb769465c8ce8808b581c7a3d" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gab16e85cdb769465c8ce8808b581c7a3d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga78309dfa0b19b697ca64d8af2e7d796d" > < td class = "memItemLeft" align = "right" valign = "top" > unsigned char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga78309dfa0b19b697ca64d8af2e7d796d" > pcppubkey_getchecksum< / a > (< a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *k)< / td > < / tr >
< tr class = "memdesc:ga78309dfa0b19b697ca64d8af2e7d796d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Calculate a checksum of a public key. < a href = "#ga78309dfa0b19b697ca64d8af2e7d796d" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga78309dfa0b19b697ca64d8af2e7d796d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gaa2678fef0a024456ee82d1bfa60c5fb2" > < td class = "memItemLeft" align = "right" valign = "top" > unsigned char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gaa2678fef0a024456ee82d1bfa60c5fb2" > pcpkey_getchecksum< / a > (< a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *k)< / td > < / tr >
< tr class = "memdesc:gaa2678fef0a024456ee82d1bfa60c5fb2" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Calculate a checksum of a public key part of the given secret key. < a href = "#gaa2678fef0a024456ee82d1bfa60c5fb2" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gaa2678fef0a024456ee82d1bfa60c5fb2" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga2cea694131a6a86a9ba76c2514ef1bff" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga2cea694131a6a86a9ba76c2514ef1bff" > pcpkey_exists< / a > (char *id)< / td > < / tr >
< tr class = "memdesc:ga2cea694131a6a86a9ba76c2514ef1bff" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Checks if a secret key structure is registered in the secret key hash. < a href = "#ga2cea694131a6a86a9ba76c2514ef1bff" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga2cea694131a6a86a9ba76c2514ef1bff" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gacad3aeb15a79c5d8d848452d33db08f8" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gacad3aeb15a79c5d8d848452d33db08f8" > pcppubkey_exists< / a > (char *id)< / td > < / tr >
< tr class = "memdesc:gacad3aeb15a79c5d8d848452d33db08f8" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Checks if a public key structure is registered in the public key hash. < a href = "#gacad3aeb15a79c5d8d848452d33db08f8" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gacad3aeb15a79c5d8d848452d33db08f8" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga201b09819c67a813de56bee423dce5c9" > < td class = "memItemLeft" align = "right" valign = "top" > unsigned char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga201b09819c67a813de56bee423dce5c9" > pcp_gennonce< / a > ()< / td > < / tr >
< tr class = "memdesc:ga201b09819c67a813de56bee423dce5c9" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Generate a nonce. < a href = "#ga201b09819c67a813de56bee423dce5c9" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga201b09819c67a813de56bee423dce5c9" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gafd7aed4591ab1ef769e5d061fe77a3de" > < td class = "memItemLeft" align = "right" valign = "top" > int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gafd7aed4591ab1ef769e5d061fe77a3de" > pcp_sanitycheck_pub< / a > (< a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *key)< / td > < / tr >
< tr class = "memdesc:gafd7aed4591ab1ef769e5d061fe77a3de" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Make a sanity check of the given public key structure. < a href = "#gafd7aed4591ab1ef769e5d061fe77a3de" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gafd7aed4591ab1ef769e5d061fe77a3de" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga749e28028744cf7206492911564c559a" > < td class = "memItemLeft" align = "right" valign = "top" > int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga749e28028744cf7206492911564c559a" > pcp_sanitycheck_key< / a > (< a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *key)< / td > < / tr >
< tr class = "memdesc:ga749e28028744cf7206492911564c559a" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Make a sanity check of the given secret key structure. < a href = "#ga749e28028744cf7206492911564c559a" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga749e28028744cf7206492911564c559a" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga8aa66f20f7671d80e75d7b05a7e692c4" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#ga8aa66f20f7671d80e75d7b05a7e692c4" > pcp_dumpkey< / a > (< a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *k)< / td > < / tr >
< tr class = "memdesc:ga8aa66f20f7671d80e75d7b05a7e692c4" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Dump a secret key structure to stderr. < a href = "#ga8aa66f20f7671d80e75d7b05a7e692c4" > < / a > < br / > < / td > < / tr >
< tr class = "separator:ga8aa66f20f7671d80e75d7b05a7e692c4" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gaf37d43db0d210b3fbeab0929e3a76ebf" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__KEYS.html#gaf37d43db0d210b3fbeab0929e3a76ebf" > pcp_dumppubkey< / a > (< a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *k)< / td > < / tr >
< tr class = "memdesc:gaf37d43db0d210b3fbeab0929e3a76ebf" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Dump a public key structure to stderr. < a href = "#gaf37d43db0d210b3fbeab0929e3a76ebf" > < / a > < br / > < / td > < / tr >
< tr class = "separator:gaf37d43db0d210b3fbeab0929e3a76ebf" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
< p > PCP public and secret key functions. < / p >
< p > Functions to generate PCP keypairs, de- and encrypt them and various related helpers. < / p >
< h2 class = "groupheader" > Typedef Documentation< / h2 >
< a class = "anchor" id = "gae88eb39995125f3b68b4ce9175b41732" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > typedef struct < a class = "el" href = "struct__pcp__key__t.html" > _pcp_key_t< / a > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Typedef for secret keys. < / p >
< p > Definition at line < a class = "el" href = "key_8h_source.html#l00113" > 113< / a > of file < a class = "el" href = "key_8h_source.html" > key.h< / a > .< / p >
< / div >
< / div >
< a class = "anchor" id = "ga859c793ca80717fdfc8ebef3e7224746" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > typedef struct < a class = "el" href = "struct__pcp__pubkey__t.html" > _pcp_pubkey_t< / a > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Typedef for public keys. < / p >
< p > Definition at line < a class = "el" href = "key_8h_source.html#l00140" > 140< / a > of file < a class = "el" href = "key_8h_source.html" > key.h< / a > .< / p >
< / div >
< / div >
< a class = "anchor" id = "gab69d94a862952b046c6f340d3c701dd0" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > typedef struct < a class = "el" href = "struct__pcp__rec__t.html" > _pcp_rec_t< / a > < a class = "el" href = "group__KEYS.html#gab69d94a862952b046c6f340d3c701dd0" > pcp_rec_t< / a > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Typedef for public keys. < / p >
< p > Definition at line < a class = "el" href = "key_8h_source.html#l00174" > 174< / a > of file < a class = "el" href = "key_8h_source.html" > key.h< / a > .< / p >
< / div >
< / div >
< h2 class = "groupheader" > Enumeration Type Documentation< / h2 >
< a class = "anchor" id = "ga19da9fe7a497dcd854feff4d29e4472d" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > enum < a class = "el" href = "group__KEYS.html#ga19da9fe7a497dcd854feff4d29e4472d" > _PCP_KEY_TYPES< / a > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Internal key types. < / p >
< dl > < dt > < b > Enumerator: < / b > < / dt > < dd > < table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < em > < a class = "anchor" id = "gga19da9fe7a497dcd854feff4d29e4472da2cbd93780b8b12601c8243317f712b99" > < / a > PCP_KEY_TYPE_MAINSECRET< / em > < / td > < td >
< p > 1 - Primary secret < / p >
< / td > < / tr >
< tr > < td valign = "top" > < em > < a class = "anchor" id = "gga19da9fe7a497dcd854feff4d29e4472da719ee3955ec3f9031d77f12759e75e62" > < / a > PCP_KEY_TYPE_SECRET< / em > < / td > < td >
< p > 2 - Other secret < / p >
< / td > < / tr >
< tr > < td valign = "top" > < em > < a class = "anchor" id = "gga19da9fe7a497dcd854feff4d29e4472da4ec09a5121dc8a4ebe8a9991058ed0f0" > < / a > PCP_KEY_TYPE_PUBLIC< / em > < / td > < td >
< p > 3 - Public < / p >
< / td > < / tr >
< tr > < td valign = "top" > < em > < a class = "anchor" id = "gga19da9fe7a497dcd854feff4d29e4472da416d3698781131f927f2fa0eaef32490" > < / a > PCP_KEYSIG_NATIVE< / em > < / td > < td >
< p > 4 - PCP native key signature < / p >
< / td > < / tr >
< tr > < td valign = "top" > < em > < a class = "anchor" id = "gga19da9fe7a497dcd854feff4d29e4472da1e1cd206d3b6397ae6e67c479956308b" > < / a > PCP_KEYSIG_PBP< / em > < / td > < td >
< p > 5 - PBP key signature < / p >
< / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "defines_8h_source.html#l00092" > 92< / a > of file < a class = "el" href = "defines_8h_source.html" > defines.h< / a > .< / p >
< / div >
< / div >
< h2 class = "groupheader" > Function Documentation< / h2 >
< a class = "anchor" id = "ga8aa66f20f7671d80e75d7b05a7e692c4" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void pcp_dumpkey < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td >
< td class = "paramname" > < em > k< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Dump a secret key structure to stderr. < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > k< / td > < td > Secret key to dump. < / td > < / tr >
< / table >
< / dd >
< / dl >
< / div >
< / div >
< a class = "anchor" id = "gaf37d43db0d210b3fbeab0929e3a76ebf" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void pcp_dumppubkey < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *  < / td >
< td class = "paramname" > < em > k< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Dump a public key structure to stderr. < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > k< / td > < td > Public key to dump. < / td > < / tr >
< / table >
< / dd >
< / dl >
< / div >
< / div >
< a class = "anchor" id = "ga201b09819c67a813de56bee423dce5c9" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > unsigned char* pcp_gennonce < / td >
< td > (< / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Generate a nonce. < / p >
< p > This function generates a 24 byte nonce used for cryptographic functions. It allocates the memory and the caller is responsible to clear and free() it after use.< / p >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a pointer to a 24 byte unsigned char array. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "gaac64db4cd21af0cf79512ea0ea43261f" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > char* pcp_getkeyid < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td >
< td class = "paramname" > < em > k< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Calculate a key-id from public key fields. < / p >
< p > This function calculates 2 JEN Hashes: one from the 'pub' field and one from the 'edpub' field. It the puts them together into a newly allocated char pointer of 17 bytes length as hex, terminated with a 0.< / p >
< p > The key-id is supposed to be collision save, but there's no guarantee. However, it's used locally only, it wont be transmitted over the network and it's not part of any exported packet.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > k< / td > < td > The secret key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a char pointer containing the key-id string. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "gab16e85cdb769465c8ce8808b581c7a3d" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > char* pcp_getpubkeyid < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *  < / td >
< td class = "paramname" > < em > k< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Calculate a key-id from public key fields. < / p >
< p > This does the same as < a class = "el" href = "group__KEYS.html#gaac64db4cd21af0cf79512ea0ea43261f" title = "Calculate a key-id from public key fields." > pcp_getkeyid()< / a > but uses a pcp_pubkey_t as input.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > k< / td > < td > The public key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a char pointer containing the key-id string. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "ga749e28028744cf7206492911564c559a" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > int pcp_sanitycheck_key < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td >
< td class = "paramname" > < em > key< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Make a sanity check of the given secret key structure. < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > key< / td > < td > The secret key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns 1 if the sanity check succeeds, 0 otherwise. Use < a class = "el" href = "group__FATALS.html#ga0ea01da59af8a06c55258d78da6cb0cb" title = "Prints error messages to STDERR, if there are some." > fatals_ifany()< / a > to check why. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "gafd7aed4591ab1ef769e5d061fe77a3de" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > int pcp_sanitycheck_pub < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *  < / td >
< td class = "paramname" > < em > key< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Make a sanity check of the given public key structure. < / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > key< / td > < td > The public key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns 1 if the sanity check succeeds, 0 otherwise. Use < a class = "el" href = "group__FATALS.html#ga0ea01da59af8a06c55258d78da6cb0cb" title = "Prints error messages to STDERR, if there are some." > fatals_ifany()< / a > to check why. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "gad91934413b36cfe316458c90ceb1eb99" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > * pcpkey_decrypt < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td >
< td class = "paramname" > < em > key< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > char *  < / td >
< td class = "paramname" > < em > passphrase< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Decrypt a secret key structure. < / p >
< p > The given passphrase will be used to calculate an encryption key using the scrypt() function.< / p >
< p > The encryption key will be used to decrypt the 'encrypted' field of the structure. If it works, the result will be dissected and put into the correspondig secret key fields.< / p >
< p > The data structure will be modified directly, no new memory will be allocated.< / p >
< p > The caller is responsible to clear the passphrase right after use and free() it as soon as possible.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in,out]< / td > < td class = "paramname" > key< / td > < td > The secret key structure.< / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > passphrase< / td > < td > The passphrase used to decrypt the key.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a pointer to the decrypted key structure or NULL in case of an error. Use < a class = "el" href = "group__FATALS.html#ga0ea01da59af8a06c55258d78da6cb0cb" title = "Prints error messages to STDERR, if there are some." > fatals_ifany()< / a > to catch them. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "ga30c2d289b43fe80562fc74068f2566ae" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > * pcpkey_encrypt < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td >
< td class = "paramname" > < em > key< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > char *  < / td >
< td class = "paramname" > < em > passphrase< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Encrypt a secret key structure. < / p >
< p > The given passphrase will be used to calculate an encryption key using the scrypt() function.< / p >
< p > The secret keys will be concatenated and encrypted, the result will be put into the 'encrypted' field. The first byte of each secret key field will be set to 0 to indicate the key is encrypted.< / p >
< p > The data structure will be modified directly, no new memory will be allocated.< / p >
< p > The caller is responsible to clear the passphrase right after use and free() it as soon as possible.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in,out]< / td > < td class = "paramname" > key< / td > < td > The secret key structure.< / td > < / tr >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > passphrase< / td > < td > The passphrase used to encrypt the key.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a pointer to the encrypted key structure or NULL in case of an error. Use < a class = "el" href = "group__FATALS.html#ga0ea01da59af8a06c55258d78da6cb0cb" title = "Prints error messages to STDERR, if there are some." > fatals_ifany()< / a > to catch them. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "ga2cea694131a6a86a9ba76c2514ef1bff" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > * pcpkey_exists < / td >
< td > (< / td >
< td class = "paramtype" > char *  < / td >
< td class = "paramname" > < em > id< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Checks if a secret key structure is registered in the secret key hash. < / p >
< p > Returns a pointer to a pcp_key_t structure if there exists a secret key structure with the given id in the secret key hash.< / p >
< p > FIXME: needs to be moved to < a class = "el" href = "keyhash_8h_source.html" > keyhash.h< / a > .< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > id< / td > < td > A null-terminated char pointer of 17 bytes containing a key-id.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a pointer to a pcp_key_t struture or NULL if no key exists. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "ga13aae5cf5986e308f1af674bedf0e6fd" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > char* pcpkey_get_art < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td >
< td class = "paramname" > < em > k< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Generate an ASCII art image of the public key part of a secret key. < / p >
< p > see < a class = "el" href = "group__KEYS.html#gabdc09d45ad7a6f9f039f9240635a743f" title = "Generate an ASCII art image of the public key." > pcppubkey_get_art()< / a > for details.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > k< / td > < td > The secret key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns an allocated char pointer containing the ASCII art image. The caller is responsible to free() it. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "gaa2678fef0a024456ee82d1bfa60c5fb2" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > unsigned char* pcpkey_getchecksum < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td >
< td class = "paramname" > < em > k< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Calculate a checksum of a public key part of the given secret key. < / p >
< p > See < a class = "el" href = "group__KEYS.html#ga78309dfa0b19b697ca64d8af2e7d796d" title = "Calculate a checksum of a public key." > pcppubkey_getchecksum()< / a > .< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > k< / td > < td > The secret key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a pointer to an 32 byte unsigned char. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "gaecf6a1829b4133350a7cb694c3eca8ad" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > * pcpkey_new < / td >
< td > (< / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Generate a new key structure. < / p >
< p > Owner and mail field must be filled by the caller. Memory for the returned pointer will be allocated by the function.< / p >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns pointer to new pcp_key_t structure. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "ga22c965c007208e860deaa4c145046283" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > * pcpkey_pub_from_secret < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732" > pcp_key_t< / a > *  < / td >
< td class = "paramname" > < em > key< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Generate a public key structure from a given secret key structure. < / p >
< p > This function extracts all required fields and fills a newly allocated pcp_pubkey_t structure.< / p >
< p > The caller is responsible to clear and free() it after use.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > key< / td > < td > The secret key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a new pcp_pubkey_t structure. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "gacad3aeb15a79c5d8d848452d33db08f8" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > * pcppubkey_exists < / td >
< td > (< / td >
< td class = "paramtype" > char *  < / td >
< td class = "paramname" > < em > id< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Checks if a public key structure is registered in the public key hash. < / p >
< p > Returns a pointer to a pcp_pubkey_t structure if there exists a public key structure with the given id in the public key hash.< / p >
< p > FIXME: needs to be moved to < a class = "el" href = "keyhash_8h_source.html" > keyhash.h< / a > .< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > id< / td > < td > A null-terminated char pointer of 17 bytes containing a key-id.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a pointer to a pcp_pubkey_t struture or NULL if no key exists. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "gabdc09d45ad7a6f9f039f9240635a743f" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > char* pcppubkey_get_art < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *  < / td >
< td class = "paramname" > < em > k< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Generate an ASCII art image of the public key. < / p >
< p > This functions originally appeared in OpenSSH rev 1.70, comitted by Alexander von Gernler, published under the BSD license.< / p >
< p > Human beings are bad at memorizing numbers, especially large numbers, but we are very good at recognizing images. This function calculates an ascii art image of a public key, which the user shall always see, when used. If the image changes, the user would immediately recognize the change, even unconsciously.< / p >
< p > Sample random art image from the following public key:< / p >
< div class = "fragment" > < div class = "line" > c308455ed4cf0c140bf48bfb0d87c4999c66e823bbe74ff16e2a9adc8e770747< / div >
< div class = "line" > < / div >
< div class = "line" > +----------------+< / div >
< div class = "line" > | .o.ooo. |< / div >
< div class = "line" > | o . o |< / div >
< div class = "line" > | . . = |< / div >
< div class = "line" > | . o + |< / div >
< div class = "line" > | . + |< / div >
< div class = "line" > | . |< / div >
< div class = "line" > | |< / div >
< div class = "line" > | |< / div >
< div class = "line" > +----------------+< / div >
< / div > <!-- fragment --> < dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > k< / td > < td > The public key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns an allocated char pointer containing the ASCII art image. The caller is responsible to free() it. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "ga78309dfa0b19b697ca64d8af2e7d796d" > < / a >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > unsigned char* pcppubkey_getchecksum < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "group__KEYS.html#ga859c793ca80717fdfc8ebef3e7224746" > pcp_pubkey_t< / a > *  < / td >
< td class = "paramname" > < em > k< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Calculate a checksum of a public key. < / p >
< p > This function calculates a 32 byte checksum of the encryption public key part of the given pcp_pubkey_t structure using crypto_hash_sha256.< / p >
< p > The returned pointer will be allocated and it is the responsibility of the caller to free() ist after use.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramdir" > [in]< / td > < td class = "paramname" > k< / td > < td > The public key structure.< / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > Returns a pointer to an 32 byte unsigned char. < / dd > < / dl >
< / div >
< / div >
< / div > <!-- contents -->
<!-- start footer part -->
< hr class = "footer" / > < address class = "footer" > < small >
2014-02-20 21:02:52 +01:00
Generated on Thu Feb 20 2014 20:58:12 for libpcp by   < a href = "http://www.doxygen.org/index.html" >
2014-02-20 20:09:24 +01:00
< img class = "footer" src = "doxygen.png" alt = "doxygen" / >
< / a > 1.8.2
< / small > < / address >
< / body >
< / html >