UTPassMirror/plugins/Pass/pass.cpp

34 lines
708 B
C++
Raw Permalink Normal View History

2019-03-13 18:38:12 +00:00
#include <QDebug>
2019-03-15 16:53:40 +00:00
#include <QFile>
2019-03-21 23:11:36 +00:00
#include <QtCore/QStandardPaths>
#include <QtCore/QDir>
2019-03-16 18:57:17 +00:00
2019-03-18 07:10:58 +00:00
#include "pass.h"
2019-03-23 19:53:02 +00:00
#include "gpg.h"
2019-03-15 16:53:40 +00:00
2019-03-23 19:53:02 +00:00
Pass::Pass()
{
m_password_store = QStandardPaths::writableLocation(
QStandardPaths::AppDataLocation).append("/.password-store");
QDir dir(m_password_store);
2019-03-21 23:11:36 +00:00
if (!dir.exists())
dir.mkpath(".");
2019-03-23 19:53:02 +00:00
qDebug() << "Password Store is :" << m_password_store;
}
bool Pass::gpgImportKeyFromFile(QString path)
{
return Gpg::instance()->importKeyFromFile(path);
}
QStringList Pass::gpgListAllKeys()
{
return Gpg::instance()->getAllKeysId();
2019-03-16 15:18:05 +00:00
}
2019-03-23 19:53:02 +00:00
bool Pass::gpgSetGpghome(QString path)
{
2019-03-23 19:53:02 +00:00
return Gpg::instance()->setGpghome(path);
2019-03-15 16:53:40 +00:00
}