Lines Matching refs:mapping

529      * @param array $mapping
534 public static function asn1map($decoded, $mapping, $special = []) argument
540 if (isset($mapping['explicit']) && is_array($decoded['content'])) {
545 case $mapping['type'] == self::TYPE_ANY:
553 … return [$inmap => self::asn1map($decoded, ['type' => $intype] + $mapping, $special)];
556 case $mapping['type'] == self::TYPE_CHOICE:
557 foreach ($mapping['children'] as $key => $option) {
577 case isset($mapping['implicit']):
578 case isset($mapping['explicit']):
579 case $decoded['type'] == $mapping['type']:
587 case $mapping['type'] < 18:
588 case $mapping['type'] > 30:
593 if (isset($mapping['implicit'])) {
594 $decoded['type'] = $mapping['type'];
602 if (isset($mapping['min']) && isset($mapping['max'])) {
603 $child = $mapping['children'];
616 foreach ($mapping['children'] as $key => $child) {
674 if (isset($mapping['min']) && isset($mapping['max'])) {
675 $child = $mapping['children'];
692 foreach ($mapping['children'] as $key => $child) {
736 foreach ($mapping['children'] as $key => $child) {
762 if (isset($mapping['mapping'])) {
773 …$bits = count($mapping['mapping']) == $size ? [] : array_fill(0, count($mapping['mapping']) - $siz…
782 $map = array_reverse($mapping['mapping']);
811 if (isset($mapping['implicit'])) {
814 if (isset($mapping['mapping'])) {
816 return isset($mapping['mapping'][$temp]) ?
817 $mapping['mapping'][$temp] :
854 * @param array $mapping
859 public static function encodeDER($source, $mapping, $special = []) argument
862 return self::encode_der($source, $mapping, null, $special);
869 * @param array $mapping
875 private static function encode_der($source, $mapping, $idx = null, $special = []) argument
882 if (isset($mapping['default']) && $source === $mapping['default']) {
893 $tag = $mapping['type'];
901 if (isset($mapping['min']) && isset($mapping['max'])) {
903 $child = $mapping['children'];
917 if ($mapping['type'] == self::TYPE_SET) {
925 foreach ($mapping['children'] as $key => $child) {
969 foreach ($mapping['children'] as $key => $child) {
1003 if ($temp && isset($mapping['cast'])) {
1004 $temp[0] = chr(($mapping['class'] << 6) | ($tag & 0x20) | $mapping['cast']);
1010 if (!isset($mapping['mapping'])) {
1016 $value = array_search($source, $mapping['mapping']);
1029 $format = $mapping['type'] == self::TYPE_UTC_TIME ? 'y' : 'Y';
1038 if (isset($mapping['mapping'])) {
1039 $bits = array_fill(0, count($mapping['mapping']), 0);
1041 for ($i = 0; $i < count($mapping['mapping']); $i++) {
1042 if (in_array($mapping['mapping'][$i], $source)) {
1048 if (isset($mapping['min']) && $mapping['min'] >= 1 && $size < $mapping['min']) {
1049 $size = $mapping['min'] - 1;
1057 for ($i = $size + 1; $i < count($mapping['mapping']); $i++) {
1088 … return self::encode_der(null, ['type' => self::TYPE_NULL] + $mapping, null, $special);
1091 … return self::encode_der($source, ['type' => self::TYPE_INTEGER] + $mapping, null, $special);
1093 … return self::encode_der($source, ['type' => self::TYPE_REAL] + $mapping, null, $special);
1095 … return self::encode_der($source, ['type' => self::TYPE_BOOLEAN] + $mapping, null, $special);
1100 … return self::encode_der($source[$typename], ['type' => $outtype] + $mapping, null, $special);
1115 return self::encode_der($source, $filters + $mapping, null, $special);
1143 if (isset($mapping['cast'])) {
1144 if (isset($mapping['explicit']) || $mapping['type'] == self::TYPE_CHOICE) {
1146 $tag = ($mapping['class'] << 6) | 0x20 | $mapping['cast'];
1148 $tag = ($mapping['class'] << 6) | (ord($temp[0]) & 0x20) | $mapping['cast'];