mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 13:44:17 +00:00
49 lines
759 B
C++
49 lines
759 B
C++
#pragma once
|
|
|
|
#include <QSslConfiguration>
|
|
#include <QSslCertificate>
|
|
#include <QSslKey>
|
|
#include <QSettings>
|
|
|
|
class IdentityManager
|
|
{
|
|
public:
|
|
QString
|
|
getUniqueId();
|
|
|
|
QByteArray
|
|
getCertificate();
|
|
|
|
QByteArray
|
|
getPrivateKey();
|
|
|
|
QSslConfiguration
|
|
getSslConfig();
|
|
|
|
static
|
|
IdentityManager*
|
|
get();
|
|
|
|
private:
|
|
IdentityManager();
|
|
|
|
QSslCertificate
|
|
getSslCertificate();
|
|
|
|
QSslKey
|
|
getSslKey();
|
|
|
|
void
|
|
createCredentials(QSettings& settings);
|
|
|
|
// Initialized in constructor
|
|
QByteArray m_CachedPrivateKey;
|
|
QByteArray m_CachedPemCert;
|
|
|
|
// Lazy initialized
|
|
QString m_CachedUniqueId;
|
|
QSslCertificate m_CachedSslCert;
|
|
QSslKey m_CachedSslKey;
|
|
|
|
static IdentityManager* s_Im;
|
|
};
|