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