24 #include <tqcstring.h>
26 #include <tqstringlist.h>
27 #include <tqvaluelist.h>
36 KPGP_VALIDITY_UNKNOWN = 0,
37 KPGP_VALIDITY_UNDEFINED = 1,
38 KPGP_VALIDITY_NEVER = 2,
39 KPGP_VALIDITY_MARGINAL = 3,
40 KPGP_VALIDITY_FULL = 4,
41 KPGP_VALIDITY_ULTIMATE = 5
49 UnknownEncryptPref = 0,
51 AlwaysEncryptIfPossible = 2,
52 AlwaysAskForEncryption = 3,
53 AskWheneverPossible = 4
57 typedef TQCString KeyID;
59 class KeyIDList :
public TQValueList<KeyID>
63 KeyIDList(
const KeyIDList& l ) : TQValueList<KeyID>(l) { }
64 KeyIDList(
const TQValueList<KeyID>& l ) : TQValueList<KeyID>(l) { }
65 KeyIDList(
const KeyID& i ) { append(i); }
67 TQStringList toStringList()
const;
69 static KeyIDList fromStringList(
const TQStringList& );
78 UserID(
const TQString& str,
79 const Validity
validity = KPGP_VALIDITY_UNKNOWN,
85 TQString
text()
const;
97 void setText(
const TQString& str);
116 typedef TQPtrList<UserID> UserIDList;
117 typedef TQPtrListIterator<UserID> UserIDListIterator;
269 bool mCanEncrypt : 1;
271 bool mCanCertify : 1;
273 unsigned int mKeyAlgo;
274 unsigned int mKeyLen;
276 TQCString mFingerprint;
338 return mKeyID.right(8);
426 typedef TQPtrList<Subkey> SubkeyList;
427 typedef TQPtrListIterator<Subkey> SubkeyListIterator;
437 Key(
const KeyID& keyid = KeyID(),
438 const TQString& uid = TQString(),
439 const bool secret =
false);
530 Validity
keyTrust(
const TQString& uid )
const;
553 const UserIDList
userIDs()
const;
556 const SubkeyList
subkeys()
const;
561 const Validity validity = KPGP_VALIDITY_UNKNOWN,
562 const bool revoked =
false,
563 const bool invalid =
false);
575 void addSubkey(
const KeyID& keyID,
const bool secret =
false);
593 bool mCanEncrypt : 1;
595 bool mCanCertify : 1;
597 EncryptPref mEncryptPref;
690 mEncryptPref = encrPref;
695 UserID *uid = mUserIDs.getFirst();
705 Subkey *key = mSubkeys.getFirst();
715 Subkey *key = mSubkeys.getFirst();
735 return (mUserIDs.isEmpty() || mSubkeys.isEmpty());
740 if( !mSubkeys.isEmpty() )
741 return mSubkeys.getFirst()->creationDate();
749 mUserIDs.append(userID);
755 mSubkeys.append(subkey);
760 typedef TQPtrList<Key> KeyListBase;
761 typedef TQPtrListIterator<Key> KeyListIterator;
763 class KeyList :
public KeyListBase
770 int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 )
773 return TQString::compare((static_cast<Key*>(s1))->primaryUserID().lower(),
774 (static_cast<Key*>(s2))->primaryUserID().lower());