moonlight-qt/app/backend/identitymanager.h

50 lines
759 B
C
Raw Normal View History

2018-04-29 02:01:00 +00:00
#pragma once
2018-05-06 04:59:30 +00:00
#include <QSslConfiguration>
#include <QSslCertificate>
#include <QSslKey>
#include <QSettings>
2018-04-29 02:01:00 +00:00
class IdentityManager
{
public:
2018-04-29 05:14:27 +00:00
QString
getUniqueId();
QByteArray
getCertificate();
QByteArray
getPrivateKey();
2018-05-06 04:59:30 +00:00
QSslConfiguration
getSslConfig();
2018-06-27 02:01:40 +00:00
static
IdentityManager*
get();
2018-04-29 02:01:00 +00:00
private:
2018-06-27 02:01:40 +00:00
IdentityManager();
QSslCertificate
getSslCertificate();
2018-04-29 02:01:00 +00:00
QSslKey
getSslKey();
void
createCredentials(QSettings& settings);
// Initialized in constructor
2018-04-29 02:01:00 +00:00
QByteArray m_CachedPrivateKey;
2018-04-29 05:14:27 +00:00
QByteArray m_CachedPemCert;
// Lazy initialized
2018-04-29 05:14:27 +00:00
QString m_CachedUniqueId;
QSslCertificate m_CachedSslCert;
QSslKey m_CachedSslKey;
2018-06-27 02:01:40 +00:00
static IdentityManager* s_Im;
2018-04-29 02:01:00 +00:00
};