aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/openssl/crypto/rsa.h
diff options
context:
space:
mode:
authorqrort <qrort@yandex-team.com>2022-11-30 23:47:12 +0300
committerqrort <qrort@yandex-team.com>2022-11-30 23:47:12 +0300
commit22f8ae0e3f5d68b92aecccdf96c1d841a0334311 (patch)
treebffa27765faf54126ad44bcafa89fadecb7a73d7 /library/cpp/openssl/crypto/rsa.h
parent332b99e2173f0425444abb759eebcb2fafaa9209 (diff)
downloadydb-22f8ae0e3f5d68b92aecccdf96c1d841a0334311.tar.gz
validate canons without yatest_common
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;
+ };
+ };
+}