store and check remote Identity

This commit is contained in:
orignal 2014-08-06 11:09:06 -04:00
parent c9c311c41e
commit f811b19cf1
4 changed files with 49 additions and 14 deletions

View file

@ -71,14 +71,28 @@ namespace data
uint8_t signingKey[128];
};
const uint8_t CERTIFICATE_TYPE_NULL = 0;
const uint8_t CERTIFICATE_TYPE_HASHCASH = 1;
const uint8_t CERTIFICATE_TYPE_HIDDEN = 2;
const uint8_t CERTIFICATE_TYPE_SIGNED = 3;
const uint8_t CERTIFICATE_TYPE_MULTIPLE = 4;
const uint8_t CERTIFICATE_TYPE_KEY = 5;
const size_t DEFAULT_IDENTITY_SIZE = 387;
struct Identity
{
uint8_t publicKey[256];
uint8_t signingKey[128];
uint8_t certificate[3];
struct
{
uint8_t type;
uint16_t length;
} certificate;
Identity& operator=(const Keys& keys);
bool FromBase64(const std::string& );
size_t FromBuffer (const uint8_t * buf, size_t len);
IdentHash Hash() const;
};