21 #include <kapplication.h>
29 : mTextData( text ), mIsBinary( false ), mType( type )
38 bool Key::operator==(
const Key &k )
const
40 if ( mIsBinary != k.mIsBinary )
return false;
42 if ( mBinaryData != k.mBinaryData )
return false;
44 if ( mTextData != k.mTextData )
return false;
45 if ( mType != k.mType )
return false;
46 if ( mCustomTypeString != k.mCustomTypeString )
return false;
51 bool Key::operator!=(
const Key &k )
const
53 return !( k == *this );
100 mCustomTypeString = custom;
110 return mCustomTypeString;
127 return i18n(
"X509" );
130 return i18n(
"PGP" );
133 return i18n(
"Custom" );
136 return i18n(
"Unknown type" );
141 TQDataStream &KABC::operator<<( TQDataStream &s,
const Key &key )
143 return s << key.mId << key.mIsBinary << key.mTextData << key.mBinaryData <<
144 key.mCustomTypeString << key.mType;
147 TQDataStream &KABC::operator>>( TQDataStream &s,
Key &key )
149 s >> key.mId >> key.mIsBinary >> key.mTextData >> key.mBinaryData >>
150 key.mCustomTypeString >> key.mType;
Key(const TQString &text=TQString::null, int type=PGP)
Constructor.
TQByteArray binaryData() const
Returns the binary data.
void setId(const TQString &id)
Sets the unique identifier.
static TQString typeLabel(int type)
Returns a translated label for a given key type.
static TypeList typeList()
Returns a list of all available key types.
A class to store an encryption key.
bool isBinary() const
Returns whether the key contains binary or text data.
static TQString randomString(int length)
TQString textData() const
Returns the text data.
void setBinaryData(const TQByteArray &binary)
Sets binary data.
void setTextData(const TQString &text)
Sets text data.
static data, shared by ALL addressee objects
void setCustomTypeString(const TQString &custom)
Sets custom type string.
TQString customTypeString() const
Returns the custom type string.
TQString id() const
Returns the unique identifier.
int type() const
Returns the type, see Type.
void setType(int type)
Sets the type, see Type.