bool LRSPublicKey::VerifyKey(AsymmetricKey &key) const { if(key.IsPrivateKey() ^ !IsPrivateKey()) { return false; } QSharedPointer<AsymmetricKey> key0(GetPublicKey()); QSharedPointer<AsymmetricKey> key1(key.GetPublicKey()); return key0 == key1; }
bool NullPublicKey::VerifyKey(AsymmetricKey &key) const { if(!IsValid() || !key.IsValid() || (IsPrivateKey() == key.IsPrivateKey())) { return false; } NullPublicKey *other = dynamic_cast<NullPublicKey *>(&key); if(!other) { return false; } return other->_key_id == _key_id; }