33 lines
812 B
C++
33 lines
812 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
|
|
{
|
|
struct PublicRSA : IRSAPublic
|
|
{
|
|
PublicRSA(rsa_key &key);
|
|
~PublicRSA();
|
|
|
|
bool Verify(const Memory::MemoryViewRead & payload,
|
|
const Memory::MemoryViewRead & signature,
|
|
AuHashing::EHashType method,
|
|
EPaddingType type) override;
|
|
|
|
bool Encrypt(const Memory::MemoryViewRead & plainText,
|
|
EPaddingType type,
|
|
Memory::ByteBuffer &out) override;
|
|
|
|
bool ToKey(ERSAKeyType type, Memory::ByteBuffer &out) override;
|
|
|
|
private:
|
|
rsa_key key_;
|
|
bool bOwned_;
|
|
};
|
|
} |