AuroraRuntime/Source/Crypto/RSA/RSAPrivate.hpp

34 lines
839 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: RSAPrivate.hpp
Date: 2021-6-12
Author: Reece
***/
#pragma once
namespace Aurora::Crypto::RSA
{
struct PrivateRSA : IRSAPrivate
{
PrivateRSA(rsa_key &key);
~PrivateRSA();
bool Sign(const Memory::MemoryViewRead & payload,
AuHashing::EHashType method,
EPaddingType type,
Memory::ByteBuffer &out) override;
bool Decrypt(const Memory::MemoryViewRead & payload,
EPaddingType type,
Memory::ByteBuffer &out) override;
AuSPtr<IRSAPublic> ToPublic() override;
bool ToKey(const RSAMeta &meta,
Memory::ByteBuffer &out) override;
private:
rsa_key key_;
};
}