diff options
author | alexvru <alexvru@ydb.tech> | 2023-08-15 21:09:36 +0300 |
---|---|---|
committer | alexvru <alexvru@ydb.tech> | 2023-08-15 21:42:49 +0300 |
commit | d6f67906ea5b369b47bce8e0a7125d66114fdbde (patch) | |
tree | c9c44a3a1a396a6cab33e1260c67f2e5b8b76ea4 /library/cpp/openssl/crypto/rsa.h | |
parent | f096c967c8a4b645763f901c889ca0335a0e5412 (diff) | |
download | ydb-d6f67906ea5b369b47bce8e0a7125d66114fdbde.tar.gz |
Support BS autoconfig KIKIMR-19031
Diffstat (limited to 'library/cpp/openssl/crypto/rsa.h')
-rw-r--r-- | library/cpp/openssl/crypto/rsa.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/library/cpp/openssl/crypto/rsa.h b/library/cpp/openssl/crypto/rsa.h new file mode 100644 index 0000000000..5cb16e195e --- /dev/null +++ b/library/cpp/openssl/crypto/rsa.h @@ -0,0 +1,34 @@ +#pragma once + +#include <util/generic/utility.h> +#include <util/generic/noncopyable.h> + +struct rsa_st; + +namespace NOpenSsl { + class TBigInteger; + + namespace NRsa { + class TPublicKey: public TNonCopyable { + public: + inline TPublicKey(TPublicKey&& other) noexcept { + Swap(other); + } + + TPublicKey(const TBigInteger& e, const TBigInteger& n); + ~TPublicKey() noexcept; + + size_t OutputLength() const noexcept; + + TBigInteger EncryptNoPad(const TBigInteger& src) const; + size_t EncryptNoPad(void* dst, const void* src, size_t size) const; + + inline void Swap(TPublicKey& other) noexcept { + DoSwap(Key_, other.Key_); + } + + private: + rsa_st* Key_ = nullptr; + }; + } +} |