38 lines
998 B
C++
38 lines
998 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
|
|
{
|
|
class PrivateRSA : public IRSAPrivate
|
|
{
|
|
public:
|
|
PrivateRSA(rsa_key &key);
|
|
~PrivateRSA();
|
|
|
|
bool Sign(const void *buffer, AuUInt length,
|
|
EHashType method, EPaddingType type,
|
|
AuList<AuUInt8> &out) override;
|
|
|
|
|
|
bool Sign(const AuList<AuUInt8> &in,
|
|
EHashType method, EPaddingType type,
|
|
AuList<AuUInt8> &out) override;
|
|
|
|
bool Decrypt(const void *buffer, AuUInt length, EPaddingType type, AuList<AuUInt8> &out) override;
|
|
|
|
bool Decrypt(const AuList<AuUInt8> &in, EPaddingType type, AuList<AuUInt8> &out) override;
|
|
|
|
AuSPtr<IRSAPublic> ToPublic() override;
|
|
|
|
bool ToKey(const RSAMeta &meta, AuList<AuUInt8> &out) override;
|
|
|
|
private:
|
|
rsa_key key_;
|
|
};
|
|
} |