LeechCraft Azoth  0.6.70-16373-g319c272718
Modular multiprotocol IM plugin for LeechCraft
LC::Azoth::ISupportPGP Class Referenceabstract

Interface for accounts supporting PGP encryption. More...

#include "isupportpgp.h"

Public Member Functions

virtual void SetPrivateKey (const QCA::PGPKey &key)=0
 Sets the private key for the account. More...
 
virtual QCA::PGPKey GetPrivateKey () const =0
 Returns the private key for the account, if any. More...
 
virtual void SetEntryKey (QObject *entry, const QCA::PGPKey &pubKey)=0
 Sets the public key for the given entry. More...
 
virtual QCA::PGPKey GetEntryKey (QObject *entry) const =0
 Returns the public key for the given entry, if any. More...
 
virtual GPGExceptions::MaybeException_t SetEncryptionEnabled (QObject *entry, bool enabled)=0
 Enables or disables encryption for the entry. More...
 
virtual bool IsEncryptionEnabled (QObject *entry) const =0
 Checks if the encryption is enabled for the entry. More...
 

Protected Member Functions

virtual ~ISupportPGP ()=default
 
virtual void signatureVerified (QObject *entry, bool successful)=0
 Notifies whether signature has been verified for the given entry. More...
 
virtual void encryptionStateChanged (QObject *entry, bool enabled)=0
 Notifies that encryption state has changed for the given entry. More...
 

Detailed Description

Interface for accounts supporting PGP encryption.

This interface should be implemented by accounts which support PGP encryption, only if ENABLE_CRYPT compile-time option is enabled.

See also
IAccount

Definition at line 27 of file isupportpgp.h.

Constructor & Destructor Documentation

◆ ~ISupportPGP()

virtual LC::Azoth::ISupportPGP::~ISupportPGP ( )
protectedvirtualdefault

Member Function Documentation

◆ encryptionStateChanged()

virtual void LC::Azoth::ISupportPGP::encryptionStateChanged ( QObject *  entry,
bool  enabled 
)
protectedpure virtual

Notifies that encryption state has changed for the given entry.

This signal should be emitted whenever encryption state changes for the given entry, even as the result of SetEncryptionEnabled() call.

Parameters
[out]entryThe entry for which encryption state has changed.
[out]enabledWhether encryption has been enabled or disabled.
See also
SetEncryptionEnabled()
IsEncryptionEnabled()

◆ GetEntryKey()

virtual QCA::PGPKey LC::Azoth::ISupportPGP::GetEntryKey ( QObject *  entry) const
pure virtual

Returns the public key for the given entry, if any.

If there is no public key for the entry, an empty key should be returned.

Parameters
[in]entryThe entry for which to return the public key.
Returns
The public key for the given entry, if any.

◆ GetPrivateKey()

virtual QCA::PGPKey LC::Azoth::ISupportPGP::GetPrivateKey ( ) const
pure virtual

Returns the private key for the account, if any.

Returns
Private key for the account, or an empty key if no key has been set.

◆ IsEncryptionEnabled()

virtual bool LC::Azoth::ISupportPGP::IsEncryptionEnabled ( QObject *  entry) const
pure virtual

Checks if the encryption is enabled for the entry.

Parameters
[in]entryThe entry for which to query the encryption status.
Returns
Whether the encryption has been enabled successfully for the entry.
See also
SetEncryptionEnabled()
encryptionStateChanged()

◆ SetEncryptionEnabled()

virtual GPGExceptions::MaybeException_t LC::Azoth::ISupportPGP::SetEncryptionEnabled ( QObject *  entry,
bool  enabled 
)
pure virtual

Enables or disables encryption for the entry.

If the encryption status has been changed successfully, the encryptionStateChanged() should be emitted afterwards.

Parameters
[in]entryThe entry for which to toggle the encryption.
[in]enabledWhether encryption should be enabled.
See also
encryptionStateChanged()

◆ SetEntryKey()

virtual void LC::Azoth::ISupportPGP::SetEntryKey ( QObject *  entry,
const QCA::PGPKey &  pubKey 
)
pure virtual

Sets the public key for the given entry.

Parameters
[in]entryThe entry for which to set the public key.
[in]pubKeyThe public key to set.

◆ SetPrivateKey()

virtual void LC::Azoth::ISupportPGP::SetPrivateKey ( const QCA::PGPKey &  key)
pure virtual

Sets the private key for the account.

Parameters
[in]keyThe private key for the account.

◆ signatureVerified()

virtual void LC::Azoth::ISupportPGP::signatureVerified ( QObject *  entry,
bool  successful 
)
protectedpure virtual

Notifies whether signature has been verified for the given entry.

This signal should be emitted whenever protocol receives a PGP signature from the given entry, no matter if that signature is valid or not. If the signature is valid, successful should be set to true, otherwise it should be false, but the signal still has to be emitted.

Note
This function is expected to be a signal.
Parameters
[out]entryThe entry for which signature has been attempted to be verified.
[out]successfulWhether verification was successful.

The documentation for this class was generated from the following file: