---
title: llarp::service::AsyncKeyExchange

---

# llarp::service::AsyncKeyExchange





Inherits from std::enable_shared_from_this< AsyncKeyExchange >

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[AsyncKeyExchange](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#function-asynckeyexchange)**(EventLoop_ptr l, [ServiceInfo](Classes/structllarp_1_1service_1_1ServiceInfo.md) r, const [Identity](Classes/structllarp_1_1service_1_1Identity.md) & localident, const [PQPubKey](Classes/structllarp_1_1AlignedBuffer.md) & introsetPubKey, const [Introduction](Classes/structllarp_1_1service_1_1Introduction.md) & remote, [IDataHandler](Classes/structllarp_1_1service_1_1IDataHandler.md) * h, const [ConvoTag](Classes/structllarp_1_1service_1_1ConvoTag.md) & t, ProtocolType proto) |
| void | **[Result](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#function-result)**(std::shared_ptr< [AsyncKeyExchange](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md) > user, std::shared_ptr< [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) > frame) |
| void | **[Encrypt](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#function-encrypt)**(std::shared_ptr< [AsyncKeyExchange](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md) > user, std::shared_ptr< [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) > frame)<br>given protocol message make protocol frame  |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| EventLoop_ptr | **[loop](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-loop)**  |
| [SharedSecret](Classes/structllarp_1_1AlignedBuffer.md) | **[sharedKey](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-sharedkey)**  |
| [ServiceInfo](Classes/structllarp_1_1service_1_1ServiceInfo.md) | **[m_remote](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-m-remote)**  |
| const [Identity](Classes/structllarp_1_1service_1_1Identity.md) & | **[m_LocalIdentity](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-m-localidentity)**  |
| [ProtocolMessage](Classes/structllarp_1_1service_1_1ProtocolMessage.md) | **[msg](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-msg)**  |
| [Introduction](Classes/structllarp_1_1service_1_1Introduction.md) | **[intro](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-intro)**  |
| const [PQPubKey](Classes/structllarp_1_1AlignedBuffer.md) | **[introPubKey](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-intropubkey)**  |
| [Introduction](Classes/structllarp_1_1service_1_1Introduction.md) | **[remoteIntro](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-remoteintro)**  |
| std::function< void(std::shared_ptr< [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) >)> | **[hook](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-hook)**  |
| [IDataHandler](Classes/structllarp_1_1service_1_1IDataHandler.md) * | **[handler](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-handler)**  |
| [ConvoTag](Classes/structllarp_1_1service_1_1ConvoTag.md) | **[tag](Classes/structllarp_1_1service_1_1AsyncKeyExchange.md#variable-tag)**  |

## Public Functions Documentation

### function AsyncKeyExchange

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


### function Result

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


### function Encrypt

```cpp
static void Encrypt(
    std::shared_ptr< AsyncKeyExchange > user,
    std::shared_ptr< ProtocolFrame > frame
)
```

given protocol message make protocol frame 

## Public Attributes Documentation

### variable loop

```cpp
EventLoop_ptr loop;
```


### variable sharedKey

```cpp
SharedSecret sharedKey;
```


### variable m_remote

```cpp
ServiceInfo m_remote;
```


### variable m_LocalIdentity

```cpp
const Identity & m_LocalIdentity;
```


### variable msg

```cpp
ProtocolMessage msg;
```


### variable intro

```cpp
Introduction intro;
```


### variable introPubKey

```cpp
const PQPubKey introPubKey;
```


### variable remoteIntro

```cpp
Introduction remoteIntro;
```


### variable hook

```cpp
std::function< void(std::shared_ptr< ProtocolFrame >)> hook;
```


### variable handler

```cpp
IDataHandler * handler;
```


### variable tag

```cpp
ConvoTag tag;
```


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

Updated on 2025-03-02 at 05:10:06 +0000