示例#1
0
文件: Attribute.php 项目: sop/x501
 /**
  * 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);
 }
示例#2
0
 /**
  * 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);
 }