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
12std::pair<std::string, std::string> computeSHA256KeyPair(uint16_t size = 2048);
13
14bool verifySHA256PublicKey(std::span<const std::byte> buffer, const std::vector<std::byte>& publicKey, std::span<const std::byte> signature);
15
16std::vector<std::byte> signDataWithSHA256PrivateKey(const std::vector<std::byte>& buffer, const std::vector<std::byte>& privateKey);
17
18} // namespace sourcepp::crypto
bool verifySHA256PublicKey(std::span< const std::byte > buffer, const std::vector< std::byte > &publicKey, std::span< const std::byte > signature)
Definition: RSA.cpp:30
std::vector< std::byte > signDataWithSHA256PrivateKey(const std::vector< std::byte > &buffer, const std::vector< std::byte > &privateKey)
Definition: RSA.cpp:36
std::pair< std::string, std::string > computeSHA256KeyPair(uint16_t size=2048)
Definition: RSA.cpp:9