initial support of LeaseSet2

This commit is contained in:
orignal 2018-12-21 15:00:03 -05:00
parent 881f7e9062
commit 12af68bdb5
4 changed files with 79 additions and 4 deletions

View file

@ -79,6 +79,15 @@ namespace data
void Encrypt (const uint8_t * data, uint8_t * encrypted, BN_CTX * ctx) const;
bool IsDestination () const { return true; };
protected:
// called from LeaseSet2
LeaseSet ();
void SetBuffer (const uint8_t * buf, size_t len);
void SetIdentity (std::shared_ptr<const IdentityEx> identity) { m_Identity = identity; };
void SetExpirationTime (uint64_t t) { m_ExpirationTime = t; };
void SetIsValid (bool isValid) { m_IsValid = isValid; };
private:
void ReadFromBuffer (bool readIdentity = true, bool verifySignature = true);
@ -101,6 +110,17 @@ namespace data
*/
bool LeaseSetBufferValidate(const uint8_t * ptr, size_t sz, uint64_t & expires);
class LeaseSet2: public LeaseSet
{
public:
LeaseSet2 (uint8_t storeType, const uint8_t * buf, size_t len);
private:
void ReadFromBuffer (uint8_t storeType, const uint8_t * buf, size_t len);
};
class LocalLeaseSet
{
public: