chore: remove unused SecureUtils::pemFileCertFingerprint

This commit is contained in:
sithlord48
2025-11-24 22:25:21 -05:00
committed by Chris Rizzitello
parent 4cb184989c
commit b6bc9202db
2 changed files with 2 additions and 20 deletions

View File

@ -62,23 +62,6 @@ Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm t
return {type, digestArray};
}
Fingerprint pemFileCertFingerprint(const std::string &path, QCryptographicHash::Algorithm type)
{
auto fp = fopenUtf8Path(path, "r");
if (!fp) {
throw std::runtime_error("could not open certificate path");
}
auto fileClose = finally([fp]() { std::fclose(fp); });
X509 *cert = PEM_read_X509(fp, nullptr, nullptr, nullptr);
if (!cert) {
throw std::runtime_error("certificate could not be parsed");
}
auto certFree = finally([cert]() { X509_free(cert); });
return sslCertFingerprint(cert, type);
}
void generatePemSelfSignedCert(const std::string &path, int keyLength)
{
auto expirationDays = 365;

View File

@ -9,7 +9,8 @@
#include "Fingerprint.h"
#include <openssl/ossl_typ.h>
#include <openssl/x509.h>
#include <string>
namespace deskflow {
@ -26,8 +27,6 @@ QString formatSSLFingerprintColumns(const QByteArray &fingerprint);
Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm type);
Fingerprint pemFileCertFingerprint(const std::string &path, QCryptographicHash::Algorithm type);
void generatePemSelfSignedCert(const std::string &path, int keyLength = 2048);
QString generateFingerprintArt(const QByteArray &rawDigest);