2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: RSAPrivate.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 PrivateRSA : IRSAPrivate
|
2021-07-01 09:18:42 +00:00
|
|
|
{
|
|
|
|
PrivateRSA(rsa_key &key);
|
|
|
|
~PrivateRSA();
|
|
|
|
|
2021-09-15 18:55:22 +00:00
|
|
|
bool Sign(const Memory::MemoryViewRead & payload,
|
2022-09-25 09:56:03 +00:00
|
|
|
AuHashing::EHashType method,
|
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
|
|
|
|
2021-09-15 18:55:22 +00:00
|
|
|
bool Decrypt(const Memory::MemoryViewRead & payload,
|
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
|
|
|
|
|
|
|
AuSPtr<IRSAPublic> ToPublic() override;
|
|
|
|
|
2022-09-19 06:01:30 +00:00
|
|
|
bool ToKey(const RSAMeta &meta,
|
|
|
|
Memory::ByteBuffer &out) override;
|
2021-07-01 09:18:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
rsa_key key_;
|
|
|
|
};
|
|
|
|
}
|