Add key update method. Fix getPrimaryUser: evaluation of most significant self signature.

This commit is contained in:
Thomas Oberndörfer
2014-02-23 20:46:52 +01:00
parent 753b1fc637
commit d6e4e3c028
2 changed files with 157 additions and 5 deletions

View File

@@ -64,3 +64,17 @@ UserAttribute.prototype.read = function(bytes) {
i += len.len;
}
};
/**
* Compare for equality
* @param {module:user_attribute~UserAttribute} usrAttr
* @return {Boolean} true if equal
*/
UserAttribute.prototype.equals = function(usrAttr) {
if (!usrAttr || !(usrAttr instanceof UserAttribute)) {
return false;
}
return this.attributes.every(function(attr, index) {
return attr === usrAttr.attributes[index];
});
};