libkazv
session-p.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of libkazv.
3  * SPDX-FileCopyrightText: 2021 Tusooa Zhu <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 
12 namespace Kazv
13 {
15  {
18  OlmAccount *acc,
19  std::string theirIdentityKey,
20  std::string theirOneTimeKey);
21 
23  RandomTag,
24  RandomData data,
25  OlmAccount *acc,
26  std::string theirIdentityKey,
27  std::string theirOneTimeKey);
28 
30  OlmAccount *acc,
31  std::string theirIdentityKey,
32  std::string message);
33 
34  SessionPrivate(const SessionPrivate &that);
35  ~SessionPrivate() = default;
36 
38  OlmSession *session{0};
39 
40  bool valid{false};
41 
42  std::string pickle() const;
43  bool unpickle(std::string data);
44 
45  std::size_t checkError(std::size_t code) const;
46 
47  std::string error() const { return olm_session_last_error(session); }
48  };
49 }
session.hpp
Kazv::RandomData
std::string RandomData
Definition: crypto-util.hpp:35
Kazv::InboundSessionTag
Definition: session.hpp:23
Kazv::SessionPrivate::error
std::string error() const
Definition: session-p.hpp:47
Kazv::SessionPrivate::unpickle
bool unpickle(std::string data)
Definition: session.cpp:108
Kazv::SessionPrivate::valid
bool valid
Definition: session-p.hpp:40
Kazv
Definition: location.hpp:10
Kazv::SessionPrivate::~SessionPrivate
~SessionPrivate()=default
Kazv::SessionPrivate
Definition: session-p.hpp:14
Kazv::SessionPrivate::session
OlmSession * session
Definition: session-p.hpp:38
Kazv::SessionPrivate::pickle
std::string pickle() const
Definition: session.cpp:98
Kazv::SessionPrivate::sessionData
ByteArray sessionData
Definition: session-p.hpp:37
Kazv::SessionPrivate::checkError
std::size_t checkError(std::size_t code) const
Definition: session.cpp:19
Kazv::ByteArray
std::vector< unsigned char > ByteArray
Definition: crypto-util.hpp:21
Kazv::OutboundSessionTag
Definition: session.hpp:24
libkazv-config.hpp
Kazv::RandomTag
The tag to indicate that a constructor should use user-provided random data.
Definition: crypto-util.hpp:33
Kazv::SessionPrivate::SessionPrivate
SessionPrivate()
Definition: session.cpp:27