Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 1 | <?xml version = "1.0" encoding="utf-8" ?>
|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
| 3 | "DTD/xhtml1-strict.dtd">
|
Jeff Burke | 92dd8e4 | 2012-12-08 11:40:31 -0800 | [diff] [blame] | 4 |
|
| 5 | <!--
|
| 6 | See COPYING for copyright and distribution information.
|
| 7 | -->
|
| 8 |
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 9 | <html xmlns = "http://www.w3.org/1999/xhtml">
|
| 10 |
|
| 11 | <head>
|
| 12 | <title>NDN Decode Face Instance</title>
|
| 13 |
|
Jeff Thompson | 38422f4 | 2012-11-15 00:20:39 -0800 | [diff] [blame] | 14 | <script type="text/javascript" src="../Helper.js"></script>
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 15 |
|
| 16 | <script type="text/javascript">
|
| 17 |
|
| 18 | function decode(){
|
| 19 |
|
| 20 | var input = document.getElementById('result').innerHTML;
|
| 21 |
|
| 22 |
|
| 23 | var faceInstance = decodeHexFaceInstance(input);
|
| 24 |
|
| 25 | if(LOG>3)console.log('FACE INSTANCE DECODED');
|
| 26 | if(LOG>3)console.log(faceInstance);
|
| 27 |
|
| 28 | ///////////////////////////////////////
|
| 29 |
|
| 30 | var output ="";
|
| 31 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 32 | if(faceInstance.publisherPublicKeyDigest!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 33 | output+= "PublisherPublicKeyDigest: ";
|
| 34 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 35 | output+= DataUtils.toHex(faceInstance.publisherPublicKeyDigest.publisherPublicKeyDigest);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 36 |
|
| 37 | //output+= "PUBLISHER ID TYPE: ";
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 38 | //output+= faceInstance.publisherPublicKeyDigest.PublisherPublicKeyDigest;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 39 |
|
| 40 | output+= "<br />";
|
| 41 | output+= "<br />";
|
| 42 |
|
| 43 | }
|
| 44 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 45 | if(faceInstance.faceID!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 46 | output+= "FaceID: ";
|
| 47 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 48 | output+= faceInstance.faceID;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 49 | output+= "<br />";
|
| 50 | }
|
| 51 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 52 | if(faceInstance.ipProto!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 53 | output+= "IPProto: ";
|
| 54 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 55 | output+= faceInstance.ipProto;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 56 | output+= "<br />";
|
| 57 | }
|
| 58 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 59 | if(faceInstance.host!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 60 | output+= "Host: ";
|
| 61 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 62 | output+= faceInstance.host;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 63 | output+= "<br />";
|
| 64 | }
|
| 65 |
|
| 66 | if(faceInstance.Port!=null){
|
| 67 | output+= "Port: ";
|
| 68 |
|
| 69 | output+= faceInstance.Port;
|
| 70 | output+= "<br />";
|
| 71 | }
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 72 | if(faceInstance.freshnessSeconds!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 73 | output+= "FreshnessSeconds: ";
|
| 74 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 75 | output+= faceInstance.freshnessSeconds;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 76 | output+= "<br />";
|
| 77 | }
|
| 78 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 79 | /*if(interest.name!=null && interest.name.components!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 80 | output+= "NAME: ";
|
| 81 |
|
| 82 | for(var i=0;i<interest.Name.Components.length;i++){
|
| 83 | output+= "/"+ DataUtils.toString(interest.Name.Components[i]);
|
| 84 | }
|
| 85 | output+= "<br />";
|
| 86 | output+= "<br />";
|
| 87 | }*/
|
| 88 |
|
| 89 | document.getElementById('result').innerHTML = output;
|
| 90 |
|
| 91 | }
|
| 92 |
|
| 93 | </script>
|
| 94 |
|
| 95 | </head>
|
| 96 | <body >
|
| 97 | <form>
|
| 98 |
|
Jeff Thompson | f3bd359 | 2012-09-29 23:25:30 -0700 | [diff] [blame] | 99 | Please Press Decode:<br />
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 100 |
|
| 101 | <!-- input id="faceInstance" type="text" name="FACEINSTANCE" value="/PARC/abc" /-->
|
| 102 |
|
| 103 | </form>
|
| 104 | <button onclick="decode()">Decode</button>
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 | <p id="result">058203e20285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f0004d29632310004da9631370004e2c631302e312e312e310004eaa6393639350003d2d6323134373438333634370000</p>
|
| 109 |
|
| 110 | </body>
|
jeff | dd4602f | 2012-09-16 16:05:01 -0700 | [diff] [blame] | 111 | </html>
|