From 0915b3ef56dfac3113cce55a59a5765dc94976be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:34:54 +0200 Subject: Adding upstream version 2.13.6. Signed-off-by: Daniel Baumann --- lib/remote/pkiutility.hpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/remote/pkiutility.hpp (limited to 'lib/remote/pkiutility.hpp') diff --git a/lib/remote/pkiutility.hpp b/lib/remote/pkiutility.hpp new file mode 100644 index 0000000..50d47e0 --- /dev/null +++ b/lib/remote/pkiutility.hpp @@ -0,0 +1,41 @@ +/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ + +#ifndef PKIUTILITY_H +#define PKIUTILITY_H + +#include "remote/i2-remote.hpp" +#include "base/exception.hpp" +#include "base/dictionary.hpp" +#include "base/string.hpp" +#include +#include + +namespace icinga +{ + +/** + * @ingroup remote + */ +class PkiUtility +{ +public: + static int NewCa(); + static int NewCert(const String& cn, const String& keyfile, const String& csrfile, const String& certfile); + static int SignCsr(const String& csrfile, const String& certfile); + static std::shared_ptr FetchCert(const String& host, const String& port); + static int WriteCert(const std::shared_ptr& cert, const String& trustedfile); + static int GenTicket(const String& cn, const String& salt, std::ostream& ticketfp); + static int RequestCertificate(const String& host, const String& port, const String& keyfile, + const String& certfile, const String& cafile, const std::shared_ptr& trustedcert, + const String& ticket = String()); + static String GetCertificateInformation(const std::shared_ptr& certificate); + static Dictionary::Ptr GetCertificateRequests(bool removed = false); + +private: + PkiUtility(); + +}; + +} + +#endif /* PKIUTILITY_H */ -- cgit v1.2.3