---
title: llarp/service/async_key_exchange.hpp

---

# llarp/service/async_key_exchange.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::service](Namespaces/namespacellarp_1_1service.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::service::AsyncKeyExchange](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md)**  |




## Source code

```cpp
#pragma once

#include <llarp/crypto/types.hpp>
#include "identity.hpp"
#include "protocol.hpp"

namespace llarp
{
  namespace service
  {
    struct AsyncKeyExchange : public std::enable_shared_from_this<AsyncKeyExchange>
    {
      EventLoop_ptr loop;
      SharedSecret sharedKey;
      ServiceInfo m_remote;
      const Identity& m_LocalIdentity;
      ProtocolMessage msg;
      Introduction intro;
      const PQPubKey introPubKey;
      Introduction remoteIntro;
      std::function<void(std::shared_ptr<ProtocolFrame>)> hook;
      IDataHandler* handler;
      ConvoTag tag;

      AsyncKeyExchange(
          EventLoop_ptr l,
          ServiceInfo r,
          const Identity& localident,
          const PQPubKey& introsetPubKey,
          const Introduction& remote,
          IDataHandler* h,
          const ConvoTag& t,
          ProtocolType proto);

      static void
      Result(std::shared_ptr<AsyncKeyExchange> user, std::shared_ptr<ProtocolFrame> frame);

      static void
      Encrypt(std::shared_ptr<AsyncKeyExchange> user, std::shared_ptr<ProtocolFrame> frame);
    };

  }  // namespace service
}  // namespace llarp
```


-------------------------------

Updated on 2022-10-17 at 13:14:50 +0000
