Lines Matching refs:content

286         $content = substr($encoded, $encoded_pos, $length);
309 'content' => $content,
317 $temp = self::decode_ber($content, $start, $content_pos);
322 // end-of-content octets - see paragraph 8.1.5
323 if (substr($content, $content_pos + $length, 2) == "\0\0") {
339 'content' => $newcontent,
340 // the only time when $content['headerlength'] isn't defined is when the length is indefinite.
341 // the absence of $content['headerlength'] is how we know if something is indefinite or not.
353 if ($constructed || strlen($content) != 1) {
356 $current['content'] = (bool) ord($content[$content_pos]);
363 $current['content'] = new BigInteger(substr($content, $content_pos), -256);
372 $current['content'] = substr($content, $content_pos);
374 $temp = self::decode_ber($content, $start, $content_pos);
378 $length -= (strlen($content) - $content_pos);
385 $current['content'] .= substr($temp[$i]['content'], 1);
391 $current['content'] = $temp[$last]['content'][0] . $current['content'] . substr($temp[$i]['content'], 1);
396 $current['content'] = substr($content, $content_pos);
398 $current['content'] = '';
400 while (substr($content, $content_pos, 2) != "\0\0") {
401 $temp = self::decode_ber($content, $length + $start, $content_pos);
410 $current['content'] .= $temp['content'];
413 if (substr($content, $content_pos, 2) == "\0\0") {
420 if ($constructed || strlen($content)) {
430 $current['content'] = [];
431 $content_len = strlen($content);
433 // if indefinite length construction was used and we have an end-of-content string next
435 if (!isset($current['headerlength']) && substr($content, $content_pos, 2) == "\0\0") {
439 $temp = self::decode_ber($content, $start + $offset, $content_pos);
444 $current['content'][] = $temp;
452 $current['content'] = self::decodeOID(substr($content, $content_pos));
453 if ($current['content'] === false) {
488 $current['content'] = substr($content, $content_pos);
495 $current['content'] = self::decodeTime(substr($content, $content_pos), $tag);
521 if (isset($mapping['explicit']) && is_array($decoded['content'])) {
522 $decoded = $decoded['content'][0];
585 foreach ($decoded['content'] as $content) {
586 if (($map[] = self::asn1map($content, $child, $special)) === null) {
594 $n = count($decoded['content']);
600 $temp = $decoded['content'][$i];
657 foreach ($decoded['content'] as $content) {
658 if (($map[] = self::asn1map($content, $child, $special)) === null) {
666 for ($i = 0; $i < count($decoded['content']); $i++) {
667 $temp = $decoded['content'][$i];
728 return isset(self::$oids[$decoded['content']]) ? self::$oids[$decoded['content']] : $decoded['content'];
732 if (is_array($decoded['content'])) {
733 $decoded['content'] = $decoded['content'][0]['content'];
738 if (!is_object($decoded['content'])) {
739 $decoded['content'] = self::decodeTime($decoded['content'], $decoded['type']);
741 return $decoded['content'] ? $decoded['content']->format(self::$format) : false;
744 $offset = ord($decoded['content'][0]);
745 $size = (strlen($decoded['content']) - 1) * 8 - $offset;
755 for ($i = strlen($decoded['content']) - 1; $i > 0; $i--) {
756 $current = ord($decoded['content'][$i]);
773 return $decoded['content'];
788 return $decoded['content'];
791 $temp = $decoded['content'];
793 $temp = new BigInteger($decoded['content'], -256);
883 foreach ($source as $content) {
884 $temp = self::encode_der($content, $child, null, $special);
1138 * @param string $content
1141 public static function decodeOID($content)
1150 $len = strlen($content);
1157 if (ord($content[$len - 1]) & 0x80) {
1163 $temp = ord($content[$pos++]);
1172 $first = floor(ord($content[0]) / 40);
1179 if ($first <= 2) { // ie. 0 <= ord($content[0]) < 120 (0x78)
1180 array_unshift($oid, ord($content[0]) % 40);
1252 * @param string $content
1256 private static function decodeTime($content, $tag)
1272 if (preg_match('#^(\d{10})(Z|[+-]\d{4})$#', $content, $matches)) {
1273 $content = $matches[1] . '00' . $matches[2];
1275 $prefix = substr($content, 0, 2) >= 50 ? '19' : '20';
1276 $content = $prefix . $content;
1277 } elseif (strpos($content, '.') !== false) {
1281 if ($content[strlen($content) - 1] == 'Z') {
1282 $content = substr($content, 0, -1) . '+0000';
1285 if (strpos($content, '-') !== false || strpos($content, '+') !== false) {
1291 return @\DateTime::createFromFormat($format, $content);