mirror of
https://github.com/QuasarApp/qca.git
synced 2025-05-08 08:49:34 +00:00
ability to compare keys
svn path=/trunk/kdesupport/qca/; revision=394989
This commit is contained in:
parent
9e0128f477
commit
d93a2e610e
@ -121,6 +121,9 @@ namespace QCA
|
||||
PublicKey toPublicKey() const;
|
||||
PrivateKey toPrivateKey() const;
|
||||
|
||||
bool operator==(const PKey &a) const;
|
||||
bool operator!=(const PKey &a) const;
|
||||
|
||||
protected:
|
||||
PKey(const QString &type, const QString &provider);
|
||||
void set(const PKey &k);
|
||||
|
@ -224,6 +224,19 @@ DHPrivateKey PKey::toDHPrivateKey() const
|
||||
return k;
|
||||
}
|
||||
|
||||
bool PKey::operator==(const PKey &a) const
|
||||
{
|
||||
if(a.isPrivate())
|
||||
return (toPrivateKey().toDER() == a.toPrivateKey().toDER());
|
||||
else
|
||||
return (toPublicKey().toDER() == a.toPublicKey().toDER());
|
||||
}
|
||||
|
||||
bool PKey::operator!=(const PKey &a) const
|
||||
{
|
||||
return !(*this == a);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// PublicKey
|
||||
//----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user