libkazv
session-p.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of libkazv.
3  * SPDX-FileCopyrightText: 2021-2024 tusooa <tusooa@kazv.moe>
4  * SPDX-License-Identifier: AGPL-3.0-or-later
5  */
6 
7 #pragma once
8 #include <libkazv-config.hpp>
9 
10 #include "session.hpp"
11 #include <vodozemac.h>
12 
13 namespace Kazv
14 {
16  {
18 
20  RandomTag,
21  RandomData data,
22  CryptoPrivate &cryptoD,
23  std::string theirIdentityKey,
24  std::string theirOneTimeKey);
25 
27  CryptoPrivate &cryptoD,
28  std::string theirIdentityKey,
29  std::string message);
30 
31  SessionPrivate(const SessionPrivate &that);
32  ~SessionPrivate() = default;
33 
34  std::optional<rust::Box<vodozemac::olm::Session>> session;
35 
36  bool valid{false};
37  std::optional<std::string> firstDecrypted;
38 
39  std::string pickle() const;
40  bool unpickle(std::string data);
41  bool unpickleFromLibolm(std::string data);
42 
44  };
45 }
Definition: maybe.hpp:25
Definition: location.hpp:10
std::string RandomData
Definition: crypto-util.hpp:34
Definition: crypto-p.hpp:26
Definition: session.hpp:21
Definition: session.hpp:22
The tag to indicate that a constructor should use user-provided random data.
Definition: crypto-util.hpp:32
Definition: session-p.hpp:16
std::string pickle() const
Definition: session.cpp:78
bool valid
Definition: session-p.hpp:36
~SessionPrivate()=default
MaybeString takeFirstDecrypted()
Definition: session.cpp:104
std::optional< rust::Box< vodozemac::olm::Session > > session
Definition: session-p.hpp:34
bool unpickle(std::string data)
Definition: session.cpp:84
SessionPrivate()
Definition: session.cpp:17
bool unpickleFromLibolm(std::string data)
Definition: session.cpp:93
std::optional< std::string > firstDecrypted
Definition: session-p.hpp:37