Ring Daemon 16.0.0
Loading...
Searching...
No Matches
sdes_negotiator.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include "media/media_codec.h"
20
21#include <stdexcept>
22#include <string>
23#include <vector>
24
25using namespace std::literals;
26
27namespace jami {
28
34class ParseError : public std::invalid_argument
35{
36public:
37 explicit ParseError(const std::string& error)
38 : std::invalid_argument(error)
39 {}
40};
41
43
45
47 Inline
48 // url, maybe at some point
49};
50
66
72static std::vector<CryptoSuiteDefinition> CryptoSuites = {
73 {"AES_CM_128_HMAC_SHA1_80"sv, 128, 112, 48, 31, AESCounterMode, 128, HMACSHA1, 80, 80, 160, 160},
74
75 {"AES_CM_128_HMAC_SHA1_32"sv, 128, 112, 48, 31, AESCounterMode, 128, HMACSHA1, 32, 80, 160, 160},
76
77 {"F8_128_HMAC_SHA1_80"sv, 128, 112, 48, 31, AESF8Mode, 128, HMACSHA1, 80, 80, 160, 160}};
78
80{
81public:
83
84 static CryptoAttribute negotiate(const std::vector<std::string>& attributes);
85
86 inline explicit operator bool() const { return not CryptoSuites.empty(); }
87
88private:
89 static std::vector<CryptoAttribute> parse(const std::vector<std::string>& attributes);
90};
91
92} // namespace jami
General exception object that is thrown when an error occurred with a regular expression operation.
ParseError(const std::string &error)
static CryptoAttribute negotiate(const std::vector< std::string > &attributes)
void emitSignal(Args... args)
Definition ring_signal.h:64
static std::vector< CryptoSuiteDefinition > CryptoSuites
List of accepted Crypto-Suites as defined in RFC4568 (6.2)
@ AESCounterMode