コード例 #1
0
ファイル: SequenceTest.php プロジェクト: afk11/phpasn1
 public function testContent()
 {
     $child1 = new Integer(123);
     $child2 = new PrintableString('Hello Wold');
     $child3 = new Boolean(true);
     $object = new Sequence($child1, $child2, $child3);
     $this->assertEquals([$child1, $child2, $child3], $object->getContent());
 }
コード例 #2
0
ファイル: Parser.php プロジェクト: phpecc/x509
 /**
  * @param Sequence $sigSection
  * @return string
  * @throws \Exception
  */
 public function parseSigAlg(Sequence $sigSection)
 {
     $sigInfo = $sigSection->getContent();
     if (!$sigInfo[0] instanceof ObjectIdentifier) {
         throw new \Exception('Invaid sig: object identfier');
     }
     return SigAlgorithmOidMapper::getAlgorithmFromOid($sigInfo[0]);
 }