2020-10-25 17:28:47 +01:00
|
|
|
/*
|
|
|
|
|
* File: KeyEdit.h
|
|
|
|
|
* Author: SET - nmset@yandex.com
|
|
|
|
|
* License : GPL v2
|
|
|
|
|
* Copyright SET - © 2019
|
|
|
|
|
*
|
|
|
|
|
* Created on October 25, 2020, 10:38 AM
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef KEYEDIT_H
|
|
|
|
|
#define KEYEDIT_H
|
|
|
|
|
|
|
|
|
|
#include <Wt/WTreeTableNode.h>
|
|
|
|
|
#include "K7Main.h"
|
|
|
|
|
#include <Wt/WComboBox.h>
|
2020-11-03 11:06:25 +01:00
|
|
|
#include "PopupCertifyUserId.h"
|
2020-11-07 22:17:44 +01:00
|
|
|
#include "PopupExpiryTime.h"
|
2020-11-19 19:16:17 +01:00
|
|
|
#include "PopupAddUid.h"
|
2020-10-25 17:28:47 +01:00
|
|
|
|
|
|
|
|
using namespace Wt;
|
|
|
|
|
|
|
|
|
|
class K7Main;
|
|
|
|
|
|
|
|
|
|
/**
|
2020-11-19 19:16:17 +01:00
|
|
|
* Some key editing functionalities are or will be implemented here.
|
|
|
|
|
* Owner trust level, key certification adding and revoking user identities are
|
|
|
|
|
* implemented.
|
|
|
|
|
* \n Is a pseudo-extension of K7Main. Both classes are friends to each other, and
|
2020-11-14 11:32:49 +01:00
|
|
|
* everything is private here.
|
2020-11-19 19:16:17 +01:00
|
|
|
* \n Does not manage keyring.
|
2020-10-25 17:28:47 +01:00
|
|
|
*/
|
2020-11-03 11:06:25 +01:00
|
|
|
class KeyEdit : public WObject
|
2020-10-25 17:28:47 +01:00
|
|
|
{
|
2020-11-14 11:32:49 +01:00
|
|
|
friend class K7Main;
|
2020-10-25 17:28:47 +01:00
|
|
|
public:
|
2020-11-14 14:46:28 +01:00
|
|
|
|
2020-11-14 11:32:49 +01:00
|
|
|
private:
|
2020-10-25 17:28:47 +01:00
|
|
|
KeyEdit(K7Main * owner);
|
|
|
|
|
virtual ~KeyEdit();
|
2020-11-14 14:46:28 +01:00
|
|
|
|
2020-11-14 11:32:49 +01:00
|
|
|
K7Main * m_owner;
|
|
|
|
|
PopupCertifyUserId * m_popupUid;
|
|
|
|
|
WString m_targetUidValidityKeyFpr;
|
2020-11-14 14:46:28 +01:00
|
|
|
|
2020-11-14 11:32:49 +01:00
|
|
|
PopupExpiryTime * m_popupExpiryTime;
|
|
|
|
|
WString m_expiryEditedKeyFpr;
|
2020-11-14 14:46:28 +01:00
|
|
|
|
2020-11-19 19:16:17 +01:00
|
|
|
PopupAddUid * m_popupAddUid;
|
|
|
|
|
WString m_addUidKeyFpr;
|
|
|
|
|
|
2020-11-14 11:32:49 +01:00
|
|
|
/**
|
|
|
|
|
* Unknown is common.
|
|
|
|
|
* \n If keyHasSecret is true, show only Ultimate level.
|
|
|
|
|
* \n Else, show everything except Ultimate.
|
|
|
|
|
* \n Undefined is not included.
|
|
|
|
|
* @param cmb
|
|
|
|
|
* @param keyHasSecret
|
|
|
|
|
*/
|
|
|
|
|
void FillOwnerTrustCombo(WComboBox * cmb, bool keyHasSecret);
|
|
|
|
|
void CertifyKey();
|
|
|
|
|
void SetExpiryTime();
|
2020-11-19 19:16:17 +01:00
|
|
|
void AddOrRevokeUid();
|
2020-11-14 14:46:28 +01:00
|
|
|
|
2020-10-25 17:28:47 +01:00
|
|
|
/**
|
|
|
|
|
* Shows a combobox with all trust levels
|
|
|
|
|
* @param keyNode
|
2020-11-06 21:42:50 +01:00
|
|
|
* @param keyHasSecret
|
2020-10-25 17:28:47 +01:00
|
|
|
*/
|
2020-11-06 21:42:50 +01:00
|
|
|
void OnOwnerTrustDoubleClicked(WTreeTableNode * keyNode, bool keyHasSecret);
|
2020-10-25 17:28:47 +01:00
|
|
|
/**
|
|
|
|
|
* Saves any changes in trust level
|
|
|
|
|
* @param keyNode
|
2020-11-06 21:42:50 +01:00
|
|
|
* @param keyHasSecret
|
2020-10-25 17:28:47 +01:00
|
|
|
*/
|
2020-11-06 21:42:50 +01:00
|
|
|
void OnOwnerTrustBlurred(WTreeTableNode * keyNode, bool keyHasSecret);
|
2020-11-03 11:06:25 +01:00
|
|
|
/**
|
|
|
|
|
* Shows a popup with parameters for key certification.
|
|
|
|
|
* @param uidNode
|
|
|
|
|
* @param privateKeys : A list of our private keys.
|
|
|
|
|
* @param targetKeyFpr : The key to sign.
|
|
|
|
|
*/
|
|
|
|
|
void OnUidValidityClicked(WTreeTableNode * uidNode, vector<WString>& privateKeys, const WString& targetKeyFpr);
|
2020-11-07 22:17:44 +01:00
|
|
|
/**
|
|
|
|
|
* Shows a popup with parameters to change expiry date.
|
|
|
|
|
* @param subkeyNode
|
|
|
|
|
* @param keyFpr
|
|
|
|
|
*/
|
|
|
|
|
void OnExpiryClicked(WTreeTableNode * subkeyNode, const WString& keyFpr);
|
2020-11-14 14:46:28 +01:00
|
|
|
|
2020-11-19 19:16:17 +01:00
|
|
|
void OnUidEmailClicked(WTreeTableNode * uidNode, const WString& keyFpr);
|
|
|
|
|
|
2020-10-25 17:28:47 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* KEYEDIT_H */
|
|
|
|
|
|