Self-test for certificate of membership.

This commit is contained in:
Adam Ierymenko 2013-10-21 15:47:33 -04:00
parent 2f00ae4fd7
commit 719dd2870d
2 changed files with 98 additions and 0 deletions

View file

@ -367,6 +367,24 @@ public:
return (p - startAt);
}
inline bool operator==(const CertificateOfMembership &c) const
throw()
{
if (_signedBy != c._signedBy)
return false;
// We have to compare in depth manually since == only compares id
if (_qualifiers.size() != c._qualifiers.size())
return false;
for(unsigned long i=0;i<_qualifiers.size();++i) {
const _Qualifier &a = _qualifiers[i];
const _Qualifier &b = c._qualifiers[i];
if ((a.id != b.id)||(a.value != b.value)||(a.maxDelta != b.maxDelta))
return false;
}
return (_signature == c._signature);
}
inline bool operator!=(const CertificateOfMembership &c) const throw() { return (!(*this == c)); }
private:
struct _Qualifier
{