/** * Initialize from ASN.1. * * @param Sequence $seq * @return self */ public static function fromASN1(Sequence $seq) { $type = AttributeType::fromASN1($seq->at(0)->asObjectIdentifier()); $values = array_map(function (UnspecifiedType $el) use($type) { return AttributeValue::fromASN1ByOID($type->oid(), $el); }, $seq->at(1)->asSet()->elements()); return new self($type, ...$values); }
/** * Initialize from ASN.1. * * @param Sequence $seq * @return self */ public static function fromASN1(Sequence $seq) { $type = AttributeType::fromASN1($seq->at(0)->asObjectIdentifier()); $value = AttributeValue::fromASN1ByOID($type->oid(), $seq->at(1)); return new self($type, $value); }