mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-22 07:11:47 +02:00
extended identity for local destination
This commit is contained in:
parent
9b8460cffa
commit
2bc1ba1a9c
10 changed files with 59 additions and 40 deletions
15
Identity.h
15
Identity.h
|
@ -109,24 +109,26 @@ namespace data
|
|||
IdentityEx (const IdentityEx& other);
|
||||
~IdentityEx ();
|
||||
IdentityEx& operator=(const IdentityEx& other);
|
||||
|
||||
IdentityEx& operator=(const Identity& standard);
|
||||
|
||||
size_t FromBuffer (const uint8_t * buf, size_t len);
|
||||
size_t ToBuffer (uint8_t * buf, size_t len) const;
|
||||
const Identity& GetStandardIdentity () const { return m_StandardIdentity; };
|
||||
const IdentHash& GetIdentHash () const { return m_IdentHash; };
|
||||
size_t GetFullLen () const { return m_ExtendedLen + DEFAULT_IDENTITY_SIZE; };
|
||||
size_t GetSigningPublicKeyLen ();
|
||||
size_t GetSignatureLen ();
|
||||
size_t GetSigningPublicKeyLen () const;
|
||||
size_t GetSignatureLen () const;
|
||||
bool Verify (const uint8_t * buf, size_t len, const uint8_t * signature);
|
||||
|
||||
private:
|
||||
|
||||
void CreateVerifier ();
|
||||
void CreateVerifier () const;
|
||||
|
||||
private:
|
||||
|
||||
Identity m_StandardIdentity;
|
||||
IdentHash m_IdentHash;
|
||||
i2p::crypto::Verifier * m_Verifier;
|
||||
mutable i2p::crypto::Verifier * m_Verifier;
|
||||
size_t m_ExtendedLen;
|
||||
uint8_t * m_ExtendedBuffer;
|
||||
};
|
||||
|
@ -201,8 +203,7 @@ namespace data
|
|||
public:
|
||||
|
||||
virtual ~LocalDestination() {};
|
||||
virtual const IdentHash& GetIdentHash () const = 0;
|
||||
virtual const Identity& GetIdentity () const = 0;
|
||||
virtual const IdentityEx& GetIdentity () const = 0;
|
||||
virtual const uint8_t * GetEncryptionPrivateKey () const = 0;
|
||||
virtual const uint8_t * GetEncryptionPublicKey () const = 0;
|
||||
virtual void Sign (const uint8_t * buf, int len, uint8_t * signature) const = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue