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
|
|
|
|
{
|
|
|
|
class PrivateRSA : public IRSAPrivate
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PrivateRSA(rsa_key &key);
|
|
|
|
~PrivateRSA();
|
|
|
|
|
2021-09-15 18:55:22 +00:00
|
|
|
bool Sign(const Memory::MemoryViewRead & payload,
|
2021-09-14 23:56:26 +00:00
|
|
|
EHashType method,
|
|
|
|
EPaddingType type,
|
2021-07-01 09:18:42 +00:00
|
|
|
AuList<AuUInt8> &out) override;
|
|
|
|
|
2021-09-15 18:55:22 +00:00
|
|
|
bool Decrypt(const Memory::MemoryViewRead & payload,
|
2021-09-14 23:56:26 +00:00
|
|
|
EPaddingType type,
|
|
|
|
AuList<AuUInt8> &out) override;
|
2021-07-01 09:18:42 +00:00
|
|
|
|
|
|
|
AuSPtr<IRSAPublic> ToPublic() override;
|
|
|
|
|
|
|
|
bool ToKey(const RSAMeta &meta, AuList<AuUInt8> &out) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
rsa_key key_;
|
|
|
|
};
|
|
|
|
}
|