/** * Initialize from ASN.1. * * @param Set $set * @return self */ public static function fromASN1(Set $set) { $attribs = array_map(function (UnspecifiedType $el) { return AttributeTypeAndValue::fromASN1($el->asSequence()); }, $set->elements()); return new self(...$attribs); }
/** * Get AttributeTypeAndValue object with this as a value. * * @return AttributeTypeAndValue */ public function toAttributeTypeAndValue() { return AttributeTypeAndValue::fromAttributeValue($this); }
/** * Check whether attribute is semantically equal to other. * * @param AttributeTypeAndValue $other Object to compare to * @return bool */ public function equals(AttributeTypeAndValue $other) { // check that attribute types match if ($this->oid() !== $other->oid()) { return false; } $matcher = $this->_value->equalityMatchingRule(); $result = $matcher->compare($this->_value->stringValue(), $other->_value->stringValue()); // match if ($result) { return true; } // no match or Undefined return false; }