chore: SecureUtils::generatePemSelfSignedCert take QString for path
This commit is contained in:
@ -115,7 +115,7 @@ bool generateCertificate()
|
||||
}
|
||||
|
||||
try {
|
||||
deskflow::generatePemSelfSignedCert(certPath.toStdString(), keyLength);
|
||||
deskflow::generatePemSelfSignedCert(certPath, keyLength);
|
||||
} catch (const std::exception &e) {
|
||||
qCritical() << "failed to generate self-signed pem cert: " << e.what();
|
||||
return false;
|
||||
|
||||
@ -62,7 +62,7 @@ Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm t
|
||||
return {type, digestArray};
|
||||
}
|
||||
|
||||
void generatePemSelfSignedCert(const std::string &path, int keyLength)
|
||||
void generatePemSelfSignedCert(const QString &path, int keyLength)
|
||||
{
|
||||
auto expirationDays = 365;
|
||||
|
||||
@ -91,7 +91,7 @@ void generatePemSelfSignedCert(const std::string &path, int keyLength)
|
||||
|
||||
X509_sign(cert, privateKey, EVP_sha256());
|
||||
|
||||
auto fp = fopenUtf8Path(path.c_str(), "w");
|
||||
auto fp = fopenUtf8Path(path.toStdString().c_str(), "w");
|
||||
if (!fp) {
|
||||
throw std::runtime_error("could not open certificate output path");
|
||||
}
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
|
||||
#include <openssl/x509.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace deskflow {
|
||||
|
||||
/**
|
||||
@ -27,7 +25,7 @@ QString formatSSLFingerprintColumns(const QByteArray &fingerprint);
|
||||
|
||||
Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm type);
|
||||
|
||||
void generatePemSelfSignedCert(const std::string &path, int keyLength = 2048);
|
||||
void generatePemSelfSignedCert(const QString &path, int keyLength = 2048);
|
||||
|
||||
QString generateFingerprintArt(const QByteArray &rawDigest);
|
||||
} // namespace deskflow
|
||||
|
||||
Reference in New Issue
Block a user