// RSAKeypair.hpp - RSA keypair generation and signing for Overte authentication #pragma once #include #include #include class RSAKeypair { public: RSAKeypair(); ~RSAKeypair(); // Generate a new 2048-bit RSA keypair bool generate(); // Sign plaintext with SHA256 + RSA std::vector sign(const std::vector& plaintext) const; // Get DER-encoded keys std::vector getPublicKeyDER() const { return m_publicKey; } std::vector getPrivateKeyDER() const { return m_privateKey; } // Set keys from DER encoding (for loading from file) void setKeys(const std::vector& publicKey, const std::vector& privateKey); // Check if keypair is valid bool isValid() const { return !m_privateKey.empty() && !m_publicKey.empty(); } private: std::vector m_publicKey; std::vector m_privateKey; };