SecretService 0.13.2d47dfe
SecretService is base back end library for your c++ Qt projects.
keystorage.h
Go to the documentation of this file.
1//#
2//# Copyright (C) 2024-2024 QuasarApp.
3//# Distributed under the GPLv3 software license, see the accompanying
4//# Everyone is permitted to copy and distribute verbatim copies
5//# of this license document, but changing it is not allowed.
6//#
7
8#ifndef KEYSTORAGE_H
9#define KEYSTORAGE_H
10
11#include "qaservice.h"
12#include <QHash>
13
14namespace QASecret {
15
19class KeyStorage: public QuasarAppUtils::Service<KeyStorage>
20{
21public:
23
30 QByteArray add(const QByteArray& value, const QString& alias = {});
31
36 void remove(const QByteArray& key);
37
42 void remove(const QString& alias);
43
44
50 QByteArray get(const QByteArray& key);
51
57 QByteArray get(const QString& alias);
58
59private:
60 QHash<QByteArray, QByteArray> _storage;
61 QHash<QString, QByteArray> _aliases;
62
63};
64}
65#endif // KEYSTORAGE_H
The KeyStorage class the storage store seccrets values on the simple key - value table....
Definition keystorage.h:20
QByteArray get(const QByteArray &key)
get return value by access key.
QByteArray add(const QByteArray &value, const QString &alias={})
add adds to storage new value, and return access key.
void remove(const QByteArray &key)
remove This method remove secret from storage by key.