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 "SecretDB/idatabase.h"
12#include "qaservice.h"
13#include <QHash>
14
15namespace QASecret {
16
17
21class KeyStorage: public QuasarAppUtils::Service<KeyStorage>
22{
23public:
24 KeyStorage(const QSharedPointer<DBSecret::IDataBase>& db);
25
32 QByteArray add(const QByteArray& value, const QString& alias = {});
33
38 void remove(const QByteArray& key);
39
44 void remove(const QString& alias);
45
51 QByteArray get(const QByteArray& key);
52
58 QByteArray get(const QString& alias);
59
60private:
61 QSharedPointer<DBSecret::IDataBase> _db;
62
63};
64}
65#endif // KEYSTORAGE_H
QByteArray get(const QByteArray &key)
get return value by access key.
void remove(const QString &alias)
remove This method remove seccret value by alias.
QByteArray add(const QByteArray &value, const QString &alias={})
add adds to storage new value, and return access key.
QByteArray get(const QString &alias)
get return value by alias of key.
void remove(const QByteArray &key)
remove This method remove secret from storage by key.