This repository was archived by the owner on Mar 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathkeystore.cpp
74 lines (57 loc) · 1.37 KB
/
keystore.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "keystore.h"
#include "cryptocontroller_p.h"
using namespace QtDataSync;
namespace QtDataSync {
class Q_DATASYNC_EXPORT KeyStorePrivate
{
public:
explicit KeyStorePrivate(Defaults defaults);
Defaults defaults;
};
}
KeyStore::KeyStore(const Defaults &defaults, QObject *parent) :
QObject{parent},
d{new KeyStorePrivate(defaults)}
{}
QString KeyStore::setupName() const
{
return d->defaults.setupName();
}
KeyStore::~KeyStore() = default;
Defaults KeyStore::defaults() const
{
return d->defaults;
}
KeyStorePrivate::KeyStorePrivate(Defaults defaults) :
defaults{std::move(defaults)}
{}
KeyStoreException::KeyStoreException(const KeyStore * const keyStore, const QString &what) :
Exception{keyStore->defaults(), what},
_keyStoreName{keyStore->providerName()}
{}
KeyStoreException::KeyStoreException(const KeyStoreException * const other) :
Exception{other},
_keyStoreName{other->_keyStoreName}
{}
QString KeyStoreException::storeProviderName() const
{
return _keyStoreName;
}
QByteArray KeyStoreException::className() const noexcept
{
return QTDATASYNC_EXCEPTION_NAME(KeyStoreException);
}
QString KeyStoreException::qWhat() const
{
return Exception::qWhat() +
QStringLiteral("\n\tKeystore: %1")
.arg(_keyStoreName);
}
void KeyStoreException::raise() const
{
throw (*this);
}
QException *KeyStoreException::clone() const
{
return new KeyStoreException(this);
}