AuroraRuntime/Source/Crypto/RSA/RSAPublic.hpp
Reece 510928e62e [*] Linux should not raise int3 unless the binary is a debug one
TODO: investigate registering an int3 signal handler to prevent crashing under internal builds
[*] Amend MemoryViews
[*] Begin shifting towards MemoryView based binary APIs
[*] Fix public RSA key leak
[+] Some clean up and possible bug fixes
2021-09-15 00:56:26 +01:00

34 lines
807 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: RSAPublic.hpp
Date: 2021-6-12
Author: Reece
***/
#pragma once
namespace Aurora::Crypto::RSA
{
class PublicRSA : public IRSAPublic
{
public:
PublicRSA(rsa_key &key, bool owned = true);
~PublicRSA();
bool Verify(Memory::MemoryViewRead payload,
Memory::MemoryViewRead signature,
EHashType method,
EPaddingType type) override;
bool Encrypt(Memory::MemoryViewRead plainText,
EPaddingType type,
AuList<AuUInt8> &out) override;
bool ToKey(ERSAKeyType type, AuList<AuUInt8> &out) override;
private:
rsa_key key_;
bool owned_;
};
}