Botan
2.19.3
Crypto and TLS for C&
src
lib
pk_pad
padding.cpp
Go to the documentation of this file.
1
/*
2
* Sets of allowed padding schemes for public key types
3
*
4
* This file was automatically generated by ./src/scripts/oids.py on 2017-12-20
5
*
6
* All manual edits to this file will be lost. Edit the script
7
* then regenerate this source file.
8
*
9
* Botan is released under the Simplified BSD License (see license.txt)
10
*/
11
12
#include <botan/internal/padding.h>
13
#include <map>
14
#include <vector>
15
#include <string>
16
#include <algorithm>
17
18
namespace
Botan
{
19
20
const
std::map<const std::string, std::vector<std::string>>
allowed_signature_paddings
=
21
{
22
{
"DSA"
, {
"EMSA1"
} },
23
{
"ECDSA"
, {
"EMSA1"
} },
24
{
"ECGDSA"
, {
"EMSA1"
} },
25
{
"ECKCDSA"
, {
"EMSA1"
} },
26
{
"GOST-34.10"
, {
"EMSA1"
} },
27
{
"GOST-34.10-2012-256"
, {
"EMSA1"
} },
28
{
"GOST-34.10-2012-512"
, {
"EMSA1"
} },
29
{
"RSA"
, {
"EMSA4"
,
"EMSA3"
} },
30
};
31
32
const
std::vector<std::string>
get_sig_paddings
(
const
std::string algo)
33
{
34
if
(
allowed_signature_paddings
.count(algo) > 0)
35
return
allowed_signature_paddings
.at(algo);
36
return
{};
37
}
38
39
bool
sig_algo_and_pad_ok
(
const
std::string algo,
const
std::string padding)
40
{
41
std::vector<std::string> pads =
get_sig_paddings
(algo);
42
return
std::find(pads.begin(), pads.end(), padding) != pads.end();
43
}
44
}
Botan
Definition
alg_id.cpp:13
Botan::get_sig_paddings
const std::vector< std::string > get_sig_paddings(const std::string algo)
Definition
padding.cpp:32
Botan::sig_algo_and_pad_ok
bool sig_algo_and_pad_ok(const std::string algo, const std::string padding)
Definition
padding.cpp:39
Botan::allowed_signature_paddings
const std::map< const std::string, std::vector< std::string > > allowed_signature_paddings
Definition
padding.cpp:20
Generated by
1.9.8