mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-18 03:02:07 +00:00
refactor: cryptography component
This commit is contained in:
30
src/Cryptography/IPublicKeyAlgorithm.h
Normal file
30
src/Cryptography/IPublicKeyAlgorithm.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace cryptography
|
||||
{
|
||||
enum class HashingAlgorithm : std::uint8_t
|
||||
{
|
||||
RSA_HASH_SHA256,
|
||||
RSA_HASH_SHA512
|
||||
};
|
||||
|
||||
class IPublicKeyAlgorithm
|
||||
{
|
||||
public:
|
||||
IPublicKeyAlgorithm() = default;
|
||||
virtual ~IPublicKeyAlgorithm() = default;
|
||||
IPublicKeyAlgorithm(const IPublicKeyAlgorithm& other) = default;
|
||||
IPublicKeyAlgorithm(IPublicKeyAlgorithm&& other) noexcept = default;
|
||||
IPublicKeyAlgorithm& operator=(const IPublicKeyAlgorithm& other) = default;
|
||||
IPublicKeyAlgorithm& operator=(IPublicKeyAlgorithm&& other) noexcept = default;
|
||||
|
||||
virtual bool SetKey(const uint8_t* keyData, size_t keySize) = 0;
|
||||
|
||||
// If needed, add a signing method
|
||||
|
||||
virtual bool Verify(const uint8_t* signedData, size_t signedDataSize, const uint8_t* signature, size_t signatureSize) = 0;
|
||||
};
|
||||
} // namespace cryptography
|
||||
Reference in New Issue
Block a user