- added new class for certificate handling. Has two input/output format: classical pgp armoured block (old) and

new pure radix format, which is easier to parse and much more robust.
- added test program to load/parse certificates in both formats.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5403 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-08-11 20:43:10 +00:00
parent 7009b46461
commit bc07b16737
8 changed files with 567 additions and 24 deletions

View file

@ -75,10 +75,20 @@ class PGPKeyParser
static const uint8_t PGP_PACKET_TAG_USER_ID = 13 ;
static const uint8_t PGP_PACKET_TAG_SIGNATURE = 2 ;
// These functions read and move the data pointer to the next byte after the read section.
//
static uint64_t read_KeyID(unsigned char *& data) ;
static uint32_t read_125Size(unsigned char *& data) ;
static uint32_t read_partialBodyLength(unsigned char *& data) ;
static void read_packetHeader(unsigned char *& data,uint8_t& packet_tag,uint32_t& packet_length) ;
// These functions write, and indicate how many bytes where written.
//
static uint32_t write_125Size(unsigned char *data,uint32_t size) ;
// Helper functions
//
static std::string extractRadixPartFromArmouredKey(const std::string& pgp_cert,std::string& version_string);
};