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