7#include <initializer_list>
12#include <userver/utils/flags.hpp>
14#include <userver/crypto/basic_types.hpp>
15#include <userver/crypto/certificate.hpp>
16#include <userver/crypto/exception.hpp>
17#include <userver/crypto/private_key.hpp>
19USERVER_NAMESPACE_BEGIN
26 explicit Signer(
const std::string& name);
30 virtual std::string
Sign(std::initializer_list<std::string_view> data)
const = 0;
34class SignerNone
final :
public Signer {
39 std::string
Sign(std::initializer_list<std::string_view> data)
const override;
44class HmacShaSigner
final :
public Signer {
48 ~HmacShaSigner()
override;
51 std::string
Sign(std::initializer_list<std::string_view> data)
const override;
59using SignerHs1 = HmacShaSigner<
DigestSize::k160>;
60using SignerHs256 = HmacShaSigner<
DigestSize::k256>;
61using SignerHs384 = HmacShaSigner<
DigestSize::k384>;
62using SignerHs512 = HmacShaSigner<
DigestSize::k512>;
67class DsaSigner
final :
public Signer {
70 explicit DsaSigner(
const std::string& privkey,
const std::string& password = {});
73 std::string
Sign(std::initializer_list<std::string_view> data)
const override;
138 ~CmsSigner()
override;