37 std::string_view pem_key);
41 std::string_view file_path);
48 std::string_view path,
49 std::int64_t timestamp_ms)
const;
51 [[nodiscard]] std::string_view
api_key_id() const noexcept;
56 std::shared_ptr<const Impl> impl_;
58 explicit
Signer(std::shared_ptr<const Impl> impl) noexcept;
Signs Kalshi requests with an API key.
Definition signer.hpp:32
KeyType key_type() const noexcept
std::string_view api_key_id() const noexcept
Result< AuthHeaders > sign(std::string_view method, std::string_view path) const
Signs a request at the current time.
Result< AuthHeaders > sign_with_timestamp(std::string_view method, std::string_view path, std::int64_t timestamp_ms) const
Signs a request at a fixed time. Useful for tests.
static Result< Signer > from_pem(std::string_view api_key_id, std::string_view pem_key)
Loads an unencrypted PEM private key (PKCS#1 or PKCS#8).
static Result< Signer > from_pem_file(std::string_view api_key_id, std::string_view file_path)
Reads a PEM private key from a file. See from_pem().
std::expected< T, Error > Result
Result type for SDK operations.
Definition error.hpp:50
KeyType
Algorithm of the loaded API key.
Definition signer.hpp:20