diff options
Diffstat (limited to 'include/signer/noscrypt_signer.hpp')
-rw-r--r-- | include/signer/noscrypt_signer.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/signer/noscrypt_signer.hpp b/include/signer/noscrypt_signer.hpp index d2135da..606438e 100644 --- a/include/signer/noscrypt_signer.hpp +++ b/include/signer/noscrypt_signer.hpp @@ -40,6 +40,9 @@ private: std::string _localPrivateKey; std::string _localPublicKey; + std::string _remotePublicKey; + std::string _bunkerSecret; + ///< A list of relays that will be used to connect to the remote signer. std::vector<std::string> _relays; @@ -58,6 +61,24 @@ private: */ std::tuple<std::string, std::string> _createLocalKeypair(); + /** + * @brief Parses the remote signer npub from a connection token provided by the signer. + * @param connectionToken A connection token beginning with `bunker://`. + * @returns The index of the first character of the connection token's query string, or -1 if + * no valid public key could be parsed. + * @remark This function updates the `_remotePublicKey` string in its class instance by side + * effect. + */ + int _parseRemotePublicKey(std::string connectionToken); + + /** + * @brief Parses a single query param from a connection token provided by a remote signer. + * @param param A single query param from the connection token of the form `key=value`. + * @remark This function updates the `_relays` vector and the `_bunkerSecret` string in its + * class instance by side effect. + */ + void _handleConnectionTokenParam(std::string param); + #pragma region Logging void _logNoscryptInitResult(NCResult initResult); |