Update of /cvsroot/mahogany/M/include/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv22568/include/modules
Modified Files:
MCrypt.h
Log Message:
1. added InsertClickable() in addition to InsertAttachment() to MessageViewer
2. use it in PGP view filter to insert icons showing the PGP status
3. added MCryptoEngineOutputLog
Index: MCrypt.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/modules/MCrypt.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -b -u -2 -r1.7 -r1.8
--- MCrypt.h 5 Dec 2002 19:47:30 -0000 1.7
+++ MCrypt.h 5 Dec 2002 23:14:58 -0000 1.8
@@ -17,4 +17,6 @@
#include "MModule.h"
+class MCryptoEngineOutputLog;
+
class WXDLLEXPORT wxWindow;
@@ -49,4 +51,5 @@
KEYRING_CHECK_ERROR,
KEYRING_SIGNATURE_ERROR,
+ SIGNATURE_EXPIRED_ERROR,
SIGNATURE_ERROR,
PUBLIC_KEY_ENCRIPTION_ERROR,
@@ -67,4 +70,7 @@
All methods in this section return a Status enum code, in particular they
all return OK (0) on success.
+
+ They also all take an optional last parameter to collect the detailed
+ output of the crypto engine into.
*/
//@{
@@ -75,8 +81,10 @@
@param messageIn the encrypted text
@param messageOut the decrypted text (only valid if OK is returned)
+ @param log the object to place output log into, if not NULL
@return Status code, OK if decryption succeeded
*/
- virtual int Decrypt(const String& messageIn,
- String& messageOut) = 0;
+ virtual Status Decrypt(const String& messageIn,
+ String& messageOut,
+ MCryptoEngineOutputLog *log = NULL) = 0;
/**
@@ -96,9 +104,12 @@
@param user A pointer to the Id of the private key of the
sender, usually is the email address used to create that key.
+
+ @param log the object to place output log into, if not NULL
*/
- virtual int Encrypt(const String& recipient,
+ virtual Status Encrypt(const String& recipient,
const String& messageIn,
String &messageOut,
- const String& user = _T("")) = 0;
+ const String& user = _T(""),
+ MCryptoEngineOutputLog *log = NULL) = 0;
/**
@@ -107,7 +118,8 @@
Takes the user id to use and creates a signed message on output.
*/
- virtual int Sign(const String& user,
+ virtual Status Sign(const String& user,
const String& messageIn,
- String& messageOut) = 0;
+ String& messageOut,
+ MCryptoEngineOutputLog *log = NULL) = 0;
/**
@@ -117,13 +129,24 @@
messageOut. If no signature was found, returns NO_SIG_ERROR
*/
- virtual int VerifySignature(const String& messageIn,
- String& messageOut) = 0;
+ virtual Status VerifySignature(const String& messageIn,
+ String& messageOut,
+ MCryptoEngineOutputLog *log = NULL) = 0;
+
+ /**
+ Verifies the detached signature.
+
+ On success returns OK but does nothing else.
+ */
+ virtual Status
+ VerifyDetachedSignature(const String& message,
+ const String& signature,
+ MCryptoEngineOutputLog *log = NULL) = 0;
#if 0
- virtual int CheckRecipient(const String & recipient) const = 0;
+ virtual Status CheckRecipient(const String & recipient) const = 0;
- virtual int GetFingerprint(String & fp) const = 0;
+ virtual Status GetFingerprint(String & fp) const = 0;
- virtual int GetPublicKey(String & pk) const = 0;
+ virtual Status GetPublicKey(String & pk) const = 0;
#endif // 0
//@}
@@ -140,4 +163,22 @@
//@}
+};
+
+// ----------------------------------------------------------------------------
+// MCryptoEngineOutputLog: collects the crypto engine execution log
+// ----------------------------------------------------------------------------
+
+class MCryptoEngineOutputLog
+{
+public:
+ MCryptoEngineOutputLog() { }
+
+ void AddMessage(const String& line) { m_messages.Add(line); }
+
+ size_t GetMessageCount() const { return m_messages.GetCount(); }
+ const String& GetMessage(size_t n) const { return m_messages[n]; }
+
+private:
+ wxArrayString m_messages;
};
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates