userver: userver/crypto/basic_types.hpp Source File
Loading...
Searching...
No Matches
basic_types.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/crypto/basic_types.hpp
4/// @brief Common types for crypto module
5
6#include <string>
7
8#include <userver/crypto/exception.hpp>
9
10/// @cond
11struct evp_pkey_st;
12struct x509_st;
13/// @endcond
14
15USERVER_NAMESPACE_BEGIN
16
17namespace crypto {
18
19/// @cond
20using EVP_PKEY = struct evp_pkey_st;
21using X509 = struct x509_st;
22/// @endcond
23
24/// SHA digest size in bits
25enum class DigestSize { k160, k256, k384, k512 };
26
27/// Digital signature type
28enum class DsaType { kRsa, kEc, kRsaPss };
29
30/// Base class for a crypto algorithm implementation
31class NamedAlgo {
32 public:
33 explicit NamedAlgo(std::string name);
34 virtual ~NamedAlgo();
35
36 const std::string& Name() const;
37
38 private:
39 const std::string name_;
40};
41
42} // namespace crypto
43
44USERVER_NAMESPACE_END