chore: remove unused SecureUtils::pemFileCertFingerprint
This commit is contained in:
parent
4cb184989c
commit
b6bc9202db
2 changed files with 2 additions and 20 deletions
|
|
@ -62,23 +62,6 @@ Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm t
|
||||||
return {type, digestArray};
|
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)
|
void generatePemSelfSignedCert(const std::string &path, int keyLength)
|
||||||
{
|
{
|
||||||
auto expirationDays = 365;
|
auto expirationDays = 365;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
#include "Fingerprint.h"
|
#include "Fingerprint.h"
|
||||||
|
|
||||||
#include <openssl/ossl_typ.h>
|
#include <openssl/x509.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace deskflow {
|
namespace deskflow {
|
||||||
|
|
@ -26,8 +27,6 @@ QString formatSSLFingerprintColumns(const QByteArray &fingerprint);
|
||||||
|
|
||||||
Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm type);
|
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);
|
void generatePemSelfSignedCert(const std::string &path, int keyLength = 2048);
|
||||||
|
|
||||||
QString generateFingerprintArt(const QByteArray &rawDigest);
|
QString generateFingerprintArt(const QByteArray &rawDigest);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue