2025-01-29 01:13:02 +00:00
|
|
|
/*
|
|
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
|
|
|
|
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
|
|
|
|
* SPDX-FileCopyrightText: (C) 2021 Barrier Contributors
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2025-03-28 03:43:04 +00:00
|
|
|
#include "Fingerprint.h"
|
2025-01-29 04:38:54 +00:00
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <openssl/ossl_typ.h>
|
2025-01-29 01:13:02 +00:00
|
|
|
#include <string>
|
2025-01-29 02:15:50 +00:00
|
|
|
#include <vector>
|
2025-01-29 01:13:02 +00:00
|
|
|
|
|
|
|
|
namespace deskflow {
|
|
|
|
|
|
2025-01-29 02:15:50 +00:00
|
|
|
/**
|
2025-01-29 01:13:02 +00:00
|
|
|
* @brief formatSSLFingerprint Format an ssl Fingerprint
|
|
|
|
|
* @param fingerprint input string
|
|
|
|
|
* @param enableSeparators insert : seperator every byte when true
|
|
|
|
|
* @return a Formated Fingerprint String
|
|
|
|
|
*/
|
2025-03-28 03:43:04 +00:00
|
|
|
QString formatSSLFingerprint(const QByteArray &fingerprint, bool enableSeparators = true);
|
2025-01-29 01:13:02 +00:00
|
|
|
|
2025-03-28 03:43:04 +00:00
|
|
|
QString formatSSLFingerprintColumns(const QByteArray &fingerprint);
|
2025-02-09 02:42:19 +00:00
|
|
|
|
2025-05-21 02:00:50 +00:00
|
|
|
Fingerprint sslCertFingerprint(const X509 *cert, Fingerprint::Type type);
|
2025-01-29 05:22:48 +00:00
|
|
|
|
2025-03-28 03:43:04 +00:00
|
|
|
Fingerprint pemFileCertFingerprint(const std::string &path, Fingerprint::Type type);
|
2025-01-29 06:19:04 +00:00
|
|
|
|
|
|
|
|
void generatePemSelfSignedCert(const std::string &path, int keyLength = 2048);
|
|
|
|
|
|
|
|
|
|
int getCertLength(const std::string &path);
|
2025-02-09 02:42:19 +00:00
|
|
|
|
2025-03-28 03:43:04 +00:00
|
|
|
QString generateFingerprintArt(const QByteArray &rawDigest);
|
2025-01-29 01:13:02 +00:00
|
|
|
} // namespace deskflow
|