21 #include <tdeapplication.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 &TDEABC::operator<<( TQDataStream &s,
const Key &key )
143 return s << key.mId << key.mIsBinary << key.mTextData << key.mBinaryData <<
144 key.mCustomTypeString << key.mType;
147 TQDataStream &TDEABC::operator>>( TQDataStream &s,
Key &key )
149 s >> key.mId >> key.mIsBinary >> key.mTextData >> key.mBinaryData >>
150 key.mCustomTypeString >> key.mType;
A class to store an encryption key.
void setId(const TQString &id)
Sets the unique identifier.
static TypeList typeList()
Returns a list of all available key types.
void setTextData(const TQString &text)
Sets text data.
Key(const TQString &text=TQString::null, int type=PGP)
Constructor.
bool isBinary() const
Returns whether the key contains binary or text data.
void setBinaryData(const TQByteArray &binary)
Sets binary data.
static TQString typeLabel(int type)
Returns a translated label for a given key type.
TQString customTypeString() const
Returns the custom type string.
TQString textData() const
Returns the text data.
TQByteArray binaryData() const
Returns the binary data.
void setType(int type)
Sets the type, see Type.
void setCustomTypeString(const TQString &custom)
Sets custom type string.
TQString id() const
Returns the unique identifier.
int type() const
Returns the type, see Type.
static TQString randomString(int length)
static data, shared by ALL addressee objects