2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: RSAPublic.hpp
|
|
|
|
Date: 2021-6-12
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
2021-07-01 09:18:42 +00:00
|
|
|
|
|
|
|
namespace Aurora::Crypto::RSA
|
|
|
|
{
|
2022-09-19 06:01:30 +00:00
|
|
|
struct PublicRSA : IRSAPublic
|
2021-07-01 09:18:42 +00:00
|
|
|
{
|
2022-09-19 06:01:30 +00:00
|
|
|
PublicRSA(rsa_key &key);
|
2021-07-01 09:18:42 +00:00
|
|
|
~PublicRSA();
|
|
|
|
|
2021-09-15 18:55:22 +00:00
|
|
|
bool Verify(const Memory::MemoryViewRead & payload,
|
|
|
|
const Memory::MemoryViewRead & signature,
|
2022-09-25 09:56:03 +00:00
|
|
|
AuHashing::EHashType method,
|
2021-07-01 09:18:42 +00:00
|
|
|
EPaddingType type) override;
|
|
|
|
|
2021-09-15 18:55:22 +00:00
|
|
|
bool Encrypt(const Memory::MemoryViewRead & plainText,
|
2021-09-14 23:56:26 +00:00
|
|
|
EPaddingType type,
|
2022-01-20 16:04:53 +00:00
|
|
|
Memory::ByteBuffer &out) override;
|
2021-07-01 09:18:42 +00:00
|
|
|
|
2022-01-20 16:04:53 +00:00
|
|
|
bool ToKey(ERSAKeyType type, Memory::ByteBuffer &out) override;
|
2021-07-01 09:18:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
rsa_key key_;
|
2022-09-19 06:01:30 +00:00
|
|
|
bool bOwned_;
|
2021-07-01 09:18:42 +00:00
|
|
|
};
|
|
|
|
}
|