diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-23 11:57:56 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-23 11:57:56 -0700 |
| commit | 70368312039f37d08ba687b07a5caad1c57cd8de (patch) | |
| tree | a366fd60b020ce212a1ce45af022e7e1c0b31b95 /node/Identity.hpp | |
| parent | 68b4ca9b3181e69108bb4120c1c4230e3d09293b (diff) | |
| download | infinitytier-70368312039f37d08ba687b07a5caad1c57cd8de.tar.gz infinitytier-70368312039f37d08ba687b07a5caad1c57cd8de.zip | |
Sign Dictionary in doNETWORK_CONFIG_REQUEST.
Diffstat (limited to 'node/Identity.hpp')
| -rw-r--r-- | node/Identity.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/node/Identity.hpp b/node/Identity.hpp index ef7f2d77..e4522732 100644 --- a/node/Identity.hpp +++ b/node/Identity.hpp @@ -288,6 +288,19 @@ public: inline const C25519::Public &publicKey() const { return _publicKey; } /** + * @return C25519 key pair (only returns valid pair if private key is present in this Identity object) + */ + inline const C25519::Pair privateKeyPair() const + { + C25519::Pair pair; + pair.pub = _publicKey; + if (_privateKey) + pair.priv = *_privateKey; + else memset(pair.priv.data,0,ZT_C25519_PRIVATE_KEY_LEN); + return pair; + } + + /** * @return True if this identity contains something */ inline operator bool() const throw() { return (_address); } |
