28 TQStringList KeyIDList::toStringList()
const
31 for( KeyIDList::ConstIterator it = begin(); it != end(); ++it ) {
39 KeyIDList KeyIDList::fromStringList(
const TQStringList& l )
42 for( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) {
43 res << (*it).local8Bit();
51 const bool revoked,
const bool invalid)
84 Key::Key(
const KeyID& keyid,
const TQString& uid,
const bool secret) :
85 mSubkeys(), mUserIDs()
101 mEncryptPref = UnknownEncryptPref;
107 mUserIDs.setAutoDelete(
true);
109 mSubkeys.setAutoDelete(
true);
125 mEncryptPref = UnknownEncryptPref;
127 mSubkeys.setAutoDelete(
true);
129 mUserIDs.setAutoDelete(
true);
136 Validity trust = KPGP_VALIDITY_UNKNOWN;
138 for( UserIDListIterator it(mUserIDs); it.current(); ++it )
140 if( (*it)->validity() > trust )
141 trust = (*it)->validity();
150 Validity trust = KPGP_VALIDITY_UNKNOWN;
155 for( UserIDListIterator it(mUserIDs); it.current(); ++it )
157 if( (*it)->text() == uid )
158 trust = (*it)->validity();
170 for( UserIDListIterator it(mUserIDs); it.current(); ++it )
172 (*it)->setValidity( key->
keyTrust( (*it)->text() ) );
179 return ( !mRevoked && !mExpired && !mDisabled && !mInvalid );
186 return ( !mRevoked && !mExpired && !mDisabled && !mInvalid && mCanEncrypt );
193 return ( !mRevoked && !mExpired && !mDisabled && !mInvalid && mCanSign );
198 const bool revoked,
const bool invalid)
200 if (!uid.isEmpty()) {
201 UserID *userID =
new UserID(uid, validity, revoked, invalid);
202 mUserIDs.append(userID);
208 if (str.isEmpty() || mUserIDs.isEmpty())
211 for (UserIDListIterator it(mUserIDs); it.current(); ++it) {
212 if (((*it)->text().find(str, 0, cs)) != -1)
221 if (!keyID.isEmpty()) {
223 mSubkeys.append(key);
229 if (keyID.isEmpty() || mSubkeys.isEmpty())
233 bool longKeyID = (keyID.length() == 16);
235 for (SubkeyListIterator it(mSubkeys); it.current(); ++it) {
237 if ((*it)->longKeyID() == keyID)
241 if ((*it)->keyID() == keyID)
256 kdDebug(5006) <<
"Error: Can't set fingerprint. A subkey with key ID 0x"
257 << keyID <<
" doesn't exist." << endl;