Subversion Repositories oidplus

Rev

Rev 1417 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1417 Rev 1420
Line 153... Line 153...
153
                $tech_info = array();
153
                $tech_info = array();
154
 
154
 
155
                $dns = $this->nodeId(false);
155
                $dns = $this->nodeId(false);
156
                $punycode = Punycode::encode($dns);
156
                $punycode = Punycode::encode($dns);
157
 
157
 
-
 
158
                // More informatin about the three formats, see RFC 8499
-
 
159
 
158
                // - common (www.example.com) <== we have this nateively
160
                // - common (www.example.com) <== we have this natively
159
                if ($dns != $punycode) {
161
                if ($dns != $punycode) {
160
                        $tmp = _L('Common notation (IDN)');
162
                        $tmp = _L('Common display (IDN)');
161
                        $tech_info[$tmp] = $dns;
163
                        $tech_info[$tmp] = $dns;
162
                        $tmp = _L('Common notation (Punycode)');
164
                        $tmp = _L('Common display (Punycode)');
163
                        $tech_info[$tmp] = $punycode;
165
                        $tech_info[$tmp] = $punycode;
164
                } else {
166
                } else {
165
                        $tmp = _L('Common notation');
167
                        $tmp = _L('Common display');
166
                        $tech_info[$tmp] = $punycode;
168
                        $tech_info[$tmp] = $punycode;
167
                }
169
                }
168
 
170
 
169
                // - presentation (www.example.com.)
171
                // - presentation (www.example.com.)
170
                $tmp = _L('Presentation notation');
172
                $tmp = _L('Presentation format');
171
                $tech_info[$tmp] = $punycode.'.';
173
                $tech_info[$tmp] = $punycode.'.';
172
 
174
 
173
                // - wire format (3www7example3com0)
175
                // - wire format (3www7example3com0, but actually, the numbers are octets (binary), not decimal)
174
                $wireformat = '';
176
                $bytes = [];
175
                $ary = explode('.', $punycode.'.');
177
                $ary = explode('.', $punycode.'.');
176
                foreach ($ary as $a) {
178
                foreach ($ary as $a) {
177
                        $wireformat .= strlen($a).$a;
179
                        $bytes[] = strlen($a);
-
 
180
                        for ($i=0; $i<strlen($a); $i++) {
-
 
181
                                $bytes[] = ord($a[$i]);
-
 
182
                        }
178
                }
183
                }
-
 
184
                $wireformat = c_literal($bytes);
-
 
185
                # TODO: am besten farbmarkierung innerhalb c_literal_machen ? mit <abbr> und dann <abbr> irgendwie behandeln?
-
 
186
                $wireformat = preg_replace('@(\\\\\\d{3})@i', '<span class="dns_wireformat_specialhexchar">\\1</span>', $wireformat);
-
 
187
                $wireformat = preg_replace('@(\\\\x[0-9A-Fa-f]{2})@i', '<span class="dns_wireformat_specialhexchar">\\1</span>', $wireformat);
179
                $tmp = _L('Wire format');
188
                $tmp = _L('Wire format');
180
                $tech_info[$tmp] = $wireformat;
189
                $tech_info[$tmp] = $wireformat;
181
 
190
 
182
                return $tech_info;
191
                return $tech_info;
183
        }
192
        }
Line 291... Line 300...
291
        public function getAltIds(): array {
300
        public function getAltIds(): array {
292
                if ($this->isRoot()) return array();
301
                if ($this->isRoot()) return array();
293
                $ids = parent::getAltIds();
302
                $ids = parent::getAltIds();
294
 
303
 
295
                // Note: The payload for the namebased UUID can be any notation:
304
                // Note: The payload for the namebased UUID can be any notation:
296
                // - common (www.example.com) <== we have this
305
                // - common display (www.example.com) <== we use this
297
                // - presentation (www.example.com.)
306
                // - presentation format (www.example.com.)
298
                // - wire format (3www7example3com0)
307
                // - wire format format (3www7example3com0, actually contains octets, not decimals!)
-
 
308
                // More informatin about the three formats, see RFC 8499
299
                $ids[] = new OIDplusAltId('guid', gen_uuid_md5_namebased(UUID_NAMEBASED_NS_DNS, $this->nodeId(false)), _L('Name based version 3 / MD5 UUID with namespace %1','UUID_NAMEBASED_NS_DNS'));
309
                $ids[] = new OIDplusAltId('guid', gen_uuid_md5_namebased(UUID_NAMEBASED_NS_DNS, $this->nodeId(false)), _L('Name based version 3 / MD5 UUID with namespace %1','UUID_NAMEBASED_NS_DNS'));
300
                $ids[] = new OIDplusAltId('guid', gen_uuid_sha1_namebased(UUID_NAMEBASED_NS_DNS, $this->nodeId(false)), _L('Name based version 5 / SHA1 UUID with namespace %1','UUID_NAMEBASED_NS_DNS'));
310
                $ids[] = new OIDplusAltId('guid', gen_uuid_sha1_namebased(UUID_NAMEBASED_NS_DNS, $this->nodeId(false)), _L('Name based version 5 / SHA1 UUID with namespace %1','UUID_NAMEBASED_NS_DNS'));
301
 
311
 
302
                return $ids;
312
                return $ids;
303
        }
313
        }