aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/openssl/crypto/rsa.h
diff options
context:
space:
mode:
authorkomels <komels@yandex-team.ru>2022-04-14 13:10:53 +0300
committerkomels <komels@yandex-team.ru>2022-04-14 13:10:53 +0300
commit21c9b0e6b039e9765eb414c406c2b86e8cea6850 (patch)
treef40ebc18ff8958dfbd189954ad024043ca983ea5 /library/cpp/openssl/crypto/rsa.h
parent9a4effa852abe489707139c2b260dccc6f4f9aa9 (diff)
downloadydb-21c9b0e6b039e9765eb414c406c2b86e8cea6850.tar.gz
Final part on compatibility layer: LOGBROKER-7215
ref:777c67aadbf705d19034a09a792b2df61ba53697
Diffstat (limited to 'library/cpp/openssl/crypto/rsa.h')
-rw-r--r--library/cpp/openssl/crypto/rsa.h34
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..3bf9e4a233
--- /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;
+ };
+ };
+}