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 <string_view>
7#include <tuple>
8#include <vector>
9
10#include <sourcepp/Math.h>
11
12namespace sourcepp::crypto {
13
14std::pair<std::string, std::string> computeSHA256KeyPair(uint16_t size = 2048);
15
16bool verifySHA256PublicKey(std::span<const std::byte> buffer, std::span<const std::byte> publicKey, std::span<const std::byte> signature);
17
18std::vector<std::byte> signDataWithSHA256PrivateKey(std::span<const std::byte> buffer, std::span<const std::byte> privateKey);
19
20} // namespace sourcepp::crypto
std::vector< std::byte > signDataWithSHA256PrivateKey(std::span< const std::byte > buffer, std::span< const std::byte > privateKey)
Definition: RSA.cpp:38
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