function _mapInExtensions(&$root, $path, $asn1)
    {
        $extensions = &$this->_subArray($root, $path);

        if (is_array($extensions)) {
            for ($i = 0; $i < count($extensions); $i++) {
                $id = $extensions[$i]['extnId'];
                $value = &$extensions[$i]['extnValue'];
                $value = base64_decode($value);
                $decoded = $asn1->decodeBER($value);
                /* [extnValue] contains the DER encoding of an ASN.1 value
                   corresponding to the extension type identified by extnID */
                $map = $this->_getMapping($id);
                if (!is_bool($map)) {
                    $mapped = $asn1->asn1map($decoded[0], $map);
                    $value = $mapped === false ? $decoded[0] : $mapped;

                    if ($id == 'id-ce-certificatePolicies') {
                        for ($j = 0; $j < count($value); $j++) {
                            if (!isset($value[$j]['policyQualifiers'])) {
                                continue;
                            }
                            for ($k = 0; $k < count($value[$j]['policyQualifiers']); $k++) {
                                $subid = $value[$j]['policyQualifiers'][$k]['policyQualifierId'];
                                $map = $this->_getMapping($subid);
                                $subvalue = &$value[$j]['policyQualifiers'][$k]['qualifier'];
                                if ($map !== false) {
                                    $decoded = $asn1->decodeBER($subvalue);
                                    $mapped = $asn1->asn1map($decoded[0], $map);
                                    $subvalue = $mapped === false ? $decoded[0] : $mapped;
                                }
                            }
                        }
                    }
                } elseif ($map) {
                    $value = base64_encode($value);
                }
            }
        }
    }
function _mapInExtensions(&$root, $path, $asn1)
    {
        $extensions = &$this->_subArray($root, $path);

        if (is_array($extensions)) {
            for ($i = 0; $i < count($extensions); $i++) {
                $id = $extensions[$i]['extnId'];
                $value = &$extensions[$i]['extnValue'];
                $value = base64_decode($value);
                $decoded = $asn1->decodeBER($value);
                /* [extnValue] contains the DER encoding of an ASN.1 value
                   corresponding to the extension type identified by extnID */
                $map = $this->_getMapping($id);
                if (!is_bool($map)) {
                    $mapped = $asn1->asn1map($decoded[0], $map);
                    $value = $mapped === false ? $decoded[0] : $mapped;

                    if ($id == 'id-ce-certificatePolicies') {
                        for ($j = 0; $j < count($value); $j++) {
                            if (!isset($value[$j]['policyQualifiers'])) {
                                continue;
                            }
                            for ($k = 0; $k < count($value[$j]['policyQualifiers']); $k++) {
                                $subid = $value[$j]['policyQualifiers'][$k]['policyQualifierId'];
                                $map = $this->_getMapping($subid);
                                $subvalue = &$value[$j]['policyQualifiers'][$k]['qualifier'];
                                if ($map !== false) {
                                    $decoded = $asn1->decodeBER($subvalue);
                                    $mapped = $asn1->asn1map($decoded[0], $map);
                                    $subvalue = $mapped === false ? $decoded[0] : $mapped;
                                }
                            }
                        }
                    }
                } elseif ($map) {
                    $value = base64_encode($value);
                }
            }
        }
    }
function _mapInExtensions ( & $ root , $ path , $ asn1 ) { $ extensions = & $ this -> _subArray ( $ root , $ path ) ; if ( is_array ( $ extensions ) ) { for ( $ i = 0 ; $ i < count ( $ extensions ) ; $ i ++ ) { $ id = $ extensions [ $ i ] [ 'extnId' ] ; $ value = & $ extensions [ $ i ] [ 'extnValue' ] ; $ value = base64_decode ( $ value ) ; $ decoded = $ asn1 -> decodeBER ( $ value ) ; /* [extnValue] contains the DER encoding of an ASN.1 value
                   corresponding to the extension type identified by extnID */ $ map = $ this -> _getMapping ( $ id ) ; if ( ! is_bool ( $ map ) ) { $ mapped = $ asn1 -> asn1map ( $ decoded [ 0 ] , $ map ) ; $ value = $ mapped === false ? $ decoded [ 0 ] : $ mapped ; if ( $ id == 'id-ce-certificatePolicies' ) { for ( $ j = 0 ; $ j < count ( $ value ) ; $ j ++ ) { if ( ! isset ( $ value [ $ j ] [ 'policyQualifiers' ] ) ) { continue ; } for ( $ k = 0 ; $ k < count ( $ value [ $ j ] [ 'policyQualifiers' ] ) ; $ k ++ ) { $ subid = $ value [ $ j ] [ 'policyQualifiers' ] [ $ k ] [ 'policyQualifierId' ] ; $ map = $ this -> _getMapping ( $ subid ) ; $ subvalue = & $ value [ $ j ] [ 'policyQualifiers' ] [ $ k ] [ 'qualifier' ] ; if ( $ map !== false ) { $ decoded = $ asn1 -> decodeBER ( $ subvalue ) ; $ mapped = $ asn1 -> asn1map ( $ decoded [ 0 ] , $ map ) ; $ subvalue = $ mapped === false ? $ decoded [ 0 ] : $ mapped ; } } } } } elseif ( $ map ) { $ value = base64_encode ( $ value ) ; } } } }
Map extension values from octet string to extension-specific internal
format.

@param Array ref $root
@param String $path
@param Object $asn1
@access private
Map extension values from octet string to extension - specific internal format .