35 lines
981 B
C++
35 lines
981 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
|
|
{
|
|
class PublicRSA : public IRSAPublic
|
|
{
|
|
public:
|
|
PublicRSA(rsa_key &key);
|
|
~PublicRSA();
|
|
|
|
bool Verify(const void *buffer, AuUInt length,
|
|
const void *sigBuffer, AuUInt sigLength,
|
|
EHashType method,
|
|
EPaddingType type) override;
|
|
|
|
bool Verify(const AuList<AuUInt8> &buffer, const AuList<AuUInt8> &sig,
|
|
EHashType method, EPaddingType type) override;
|
|
|
|
bool Encrypt(const void *buffer, AuUInt length, EPaddingType type, AuList<AuUInt8> &out) override;
|
|
bool Encrypt(const AuList<AuUInt8> &in, EPaddingType type, AuList<AuUInt8> &out) override;
|
|
|
|
bool ToKey(ERSAKeyType type, AuList<AuUInt8> &out) override;
|
|
|
|
private:
|
|
rsa_key key_;
|
|
};
|
|
} |