mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-15 15:57:59 +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;
|
|
};
|