SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
RSA.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <span>
5#include <string>
6#include <vector>
7
8#include <sourcepp/Math.h>
9
10namespace sourcepp::crypto {
11
12[[nodiscard]] std::pair<std::string, std::string> computeSHA256KeyPair(uint16_t size = 2048);
13
14[[nodiscard]] bool verifySHA256PublicKey(std::span<const std::byte> buffer, std::span<const std::byte> publicKey, std::span<const std::byte> signature);
15
16[[nodiscard]] std::vector<std::byte> signDataWithSHA256PrivateKey(std::span<const std::byte> buffer, std::span<const std::byte> privateKey);
17
18} // namespace sourcepp::crypto
std::vector< std::byte > signDataWithSHA256PrivateKey(std::span< const std::byte > buffer, std::span< const std::byte > privateKey)
Definition RSA.cpp:36
bool verifySHA256PublicKey(std::span< const std::byte > buffer, std::span< const std::byte > publicKey, std::span< const std::byte > signature)
Definition RSA.cpp:30
std::pair< std::string, std::string > computeSHA256KeyPair(uint16_t size=2048)
Definition RSA.cpp:9