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 Interest + 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 |
|
| 14 |
|
| 15 | function decode(){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 16 |
|
| 17 | var input = document.getElementById('result').innerHTML;
|
| 18 |
|
| 19 |
|
| 20 | var interest = decodeHexInterest(input);
|
| 21 |
|
| 22 | if(LOG>3)console.log('INTEREST DECODED');
|
| 23 | if(LOG>3)console.log(interest);
|
| 24 |
|
| 25 | ///////////////////////////////////////
|
| 26 |
|
| 27 | var output ="";
|
| 28 |
|
| 29 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 30 | if(interest.name!=null && interest.name.components!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 31 | output+= "NAME: ";
|
| 32 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 33 | for(var i=0;i<interest.name.components.length;i++){
|
| 34 | output+= "/"+ DataUtils.toString(interest.name.components[i]);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 35 | }
|
| 36 | output+= "<br />";
|
| 37 | output+= "<br />";
|
| 38 | }
|
| 39 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 40 | if(interest.faceInstance!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 41 | output+= "FaceInstance: ";
|
| 42 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 43 | output+= interest.faceInstance;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 44 |
|
| 45 | output+= "<br />";
|
| 46 | output+= "<br />";
|
| 47 | }
|
| 48 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 49 | if(interest.exclude!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 50 | output+= "Exclude: ";
|
| 51 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 52 | output+= interest.exclude;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 53 |
|
| 54 | output+= "<br />";
|
| 55 | output+= "<br />";
|
| 56 | }
|
| 57 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 58 | if(interest.childSelector!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 59 | output+= "ChildSelector: ";
|
| 60 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 61 | output+= interest.childSelector;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 62 |
|
| 63 | output+= "<br />";
|
| 64 | output+= "<br />";
|
| 65 | }
|
| 66 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 67 | if(interest.answerOriginKind!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 68 | output+= "AnswerOriginKind: ";
|
| 69 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 70 | output+= interest.answerOriginKind;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 71 |
|
| 72 | output+= "<br />";
|
| 73 | output+= "<br />";
|
| 74 | }
|
| 75 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 76 | if(interest.interestLifetime!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 77 | output+= "InterestLifetime: ";
|
| 78 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 79 | output+= interest.interestLifetime;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 80 |
|
| 81 | output+= "<br />";
|
| 82 | output+= "<br />";
|
| 83 | }
|
| 84 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 85 | if(interest.nonce!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 86 | output+= "Nonce: ";
|
| 87 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 88 | output+= interest.nonce;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 89 |
|
| 90 | output+= "<br />";
|
| 91 | output+= "<br />";
|
| 92 | }
|
| 93 |
|
| 94 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 95 | if(interest.scope!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 96 | output+= "SCOPE: ";
|
| 97 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 98 | output+= interest.scope;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 99 |
|
| 100 | output+= "<br />";
|
| 101 | output+= "<br />";
|
| 102 | }
|
| 103 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 104 | if(interest.publisherPublicKeyDigest!=null ){
|
| 105 | output+= "PUBLISHER PUBLIC KEY DIGEST: ";
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 106 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 107 | output+= interest.publisherPublicKeyDigest.publisherPublicKeyDigest;
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 108 |
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 109 | output+= "<br />";
|
| 110 | output+= "<br />";
|
| 111 | }
|
| 112 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 113 | if(interest.maxSuffixComponents!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 114 | output+= "MaxSuffixComponents : ";
|
| 115 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 116 | output+= interest.maxSuffixComponents;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 117 |
|
| 118 | output+= "<br />";
|
| 119 | output+= "<br />";
|
| 120 | }
|
| 121 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 122 | if(interest.minSuffixComponents!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 123 | output+= "MinSuffixComponents : ";
|
| 124 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 125 | output+= interest.minSuffixComponents;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 126 |
|
| 127 | output+= "<br />";
|
| 128 | output+= "<br />";
|
| 129 | }
|
| 130 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 131 | if(interest.name.components[3] !=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 132 |
|
| 133 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 134 | var input = DataUtils.toHex(interest.name.components[3]) ;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 135 |
|
| 136 | var contentObject = decodeHexContentObject(input);
|
| 137 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 138 | if(contentObject.content!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 139 | output+= "Content of content Object: ";
|
| 140 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 141 | output+= DataUtils.toHex(contentObject.content);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 142 |
|
| 143 | output+= "<br />";
|
| 144 | output+= "<br />";
|
| 145 | }
|
| 146 |
|
| 147 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 148 | var content = DataUtils.toHex(contentObject.content);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 149 |
|
| 150 | var co = contentObject;
|
| 151 |
|
| 152 |
|
| 153 | ////////////////////////////////////////
|
| 154 |
|
| 155 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 156 | if(co.name!=null && co.name.components!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 157 | output+= "NAME: ";
|
| 158 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 159 | for(var i=0;i<co.name.components.length;i++){
|
| 160 | output+= "/"+ DataUtils.toString(co.name.components[i]);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 161 | }
|
| 162 | output+= "<br />";
|
| 163 | output+= "<br />";
|
| 164 | }
|
| 165 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 166 | if(co.content !=null){
|
| 167 | output += "CONTENT(ASCII): "+ DataUtils.toString(co.content);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 168 |
|
| 169 | output+= "<br />";
|
| 170 | output+= "<br />";
|
| 171 | }
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 172 | if(co.content !=null){
|
| 173 | output += "CONTENT(hex): "+ DataUtils.toHex(co.content);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 174 |
|
| 175 | output+= "<br />";
|
| 176 | output+= "<br />";
|
| 177 | }
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 178 | if(co.signature !=null && co.signature.signature!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 179 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 180 | output += "SIGNATURE(hex): "+ DataUtils.toHex(co.signature.signature);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 181 |
|
| 182 | output+= "<br />";
|
| 183 | output+= "<br />";
|
| 184 | }
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 185 | if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 186 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 187 | output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 188 |
|
| 189 | output+= "<br />";
|
| 190 | output+= "<br />";
|
| 191 | }
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 192 | if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 193 | var d = new Date();
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 194 | d.setTime( co.signedInfo.timestamp.msec );
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 195 |
|
| 196 | var bytes = [217, 185, 12, 225, 217, 185, 12, 225];
|
| 197 |
|
| 198 | output += "TimeStamp: "+d;
|
| 199 | output+= "<br />";
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 200 | output += "TimeStamp(number): "+ co.signedInfo.timestamp.msec;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 201 |
|
| 202 |
|
| 203 | output+= "<br />";
|
| 204 | }
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 205 | if(co.signedInfo !=null && co.signedInfo.type!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 206 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 207 | output += "Type: "+co.signedInfo.type;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 208 | output+= "<br />";
|
| 209 | output+= "<br />";
|
| 210 | }
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 211 | if(co.signedInfo !=null && co.signedInfo.locator!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 212 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 213 | output += "Locator: "+co.signedInfo.locator.type;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 214 | output+= "<br />";
|
| 215 | output+= "<br />";
|
| 216 | }
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 217 | if(co.signedInfo !=null && co.signedInfo.freshnessSeconds!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 218 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 219 | output += "FreshnessSeconds: "+co.signedInfo.freshnessSeconds;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 220 | output+= "<br />";
|
| 221 | output+= "<br />";
|
| 222 | }
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 223 | if(co.signedInfo !=null && co.signedInfo.finalBlockID!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 224 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 225 | output += "FinalBlockID: "+co.signedInfo.finalBlockID;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 226 | output+= "<br />";
|
| 227 | output+= "<br />";
|
| 228 | }
|
| 229 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 230 | if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 231 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 232 | var publickey = rstr2b64(DataUtils.toString(co.signedInfo.locator.publicKey));
|
| 233 | var publickeyHex = DataUtils.toHex(co.signedInfo.locator.publicKey).toLowerCase();
|
| 234 | var publickeyString = DataUtils.toString(co.signedInfo.locator.publicKey);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 235 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 236 | var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 237 |
|
| 238 |
|
| 239 | var input = DataUtils.toString(co.rawSignatureData);
|
| 240 |
|
| 241 |
|
| 242 | output += "DER Certificate: "+publickey ;
|
| 243 |
|
| 244 | output+= "<br />";
|
| 245 | output+= "<br />";
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 | if(LOG>2) console.log(" ContentName + SignedInfo + Content = "+input);
|
| 250 | if(LOG>2) console.log(" PublicKey = "+publickey );
|
| 251 | if(LOG>2) console.log(" PublicKeyHex = "+publickeyHex );
|
| 252 | if(LOG>2) console.log(" PublicKeyString = "+publickeyString );
|
| 253 |
|
| 254 | if(LOG>2) console.log(" Signature "+signature );
|
| 255 |
|
| 256 | if(LOG>2) console.log(" Signature NOW IS" );
|
| 257 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 258 | if(LOG>2) console.log(co.signature.signature);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 259 |
|
| 260 |
|
| 261 | /*var x509 = new X509();
|
| 262 |
|
| 263 | x509.readCertPEM(publickey);
|
| 264 |
|
| 265 |
|
| 266 | //x509.readCertPEMWithoutRSAInit(publickey);
|
| 267 |
|
| 268 | var result = x509.subjectPublicKeyRSA.verifyString(input, signature);*/
|
| 269 | //console.log('result is '+result);
|
| 270 |
|
| 271 |
|
| 272 | var kp = publickeyHex.slice(56,314);
|
| 273 |
|
| 274 | output += "PUBLISHER KEY(hex): "+kp ;
|
| 275 |
|
| 276 | output+= "<br />";
|
| 277 | output+= "<br />";
|
| 278 |
|
| 279 | console.log('PUBLIC KEY IN HEX is ');
|
| 280 | console.log(kp);
|
| 281 |
|
| 282 | var exp = publickeyHex.slice(318,324);
|
| 283 |
|
| 284 | console.log('kp size is '+kp.length );
|
| 285 | output += "exponent: "+exp ;
|
| 286 |
|
| 287 | output+= "<br />";
|
| 288 | output+= "<br />";
|
| 289 |
|
| 290 | console.log('EXPONENT is ');
|
| 291 | console.log(exp);
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 | /*var c1 = hex_sha256(input);
|
| 296 | var c2 = signature;
|
| 297 |
|
| 298 | if(LOG>4)console.log('input is ');
|
| 299 | if(LOG>4)console.log(input);
|
| 300 | if(LOG>4)console.log('C1 is ');
|
| 301 | if(LOG>4)console.log(c1);
|
| 302 | if(LOG>4)console.log('C2 is ');
|
| 303 | if(LOG>4)console.log(c2);
|
| 304 | var result = c1 == c2;*/
|
| 305 |
|
| 306 | var rsakey = new RSAKey();
|
| 307 |
|
| 308 | rsakey.setPublic(kp,exp);
|
| 309 |
|
| 310 | var result = rsakey.verifyString(input, signature);
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 | console.log('PUBLIC KEY n after is ');
|
| 315 | console.log(rsakey.n);
|
| 316 |
|
| 317 | console.log('EXPONENT e after is ');
|
| 318 | console.log(rsakey.e);
|
| 319 |
|
| 320 |
|
| 321 | if(result)
|
| 322 | output += 'SIGNATURE VALID';
|
| 323 | else
|
| 324 | output += 'SIGNATURE INVALID';
|
| 325 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 326 | //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 327 |
|
| 328 | output+= "<br />";
|
| 329 | output+= "<br />";
|
| 330 |
|
| 331 |
|
| 332 | //if(LOG>4) console.log('str'[1]);
|
| 333 | }
|
| 334 |
|
| 335 | ////////////////////////////////////////
|
| 336 |
|
| 337 |
|
| 338 | var forwardingEntry = decodeHexForwardingEntry(content);
|
| 339 |
|
| 340 | if(LOG>3)console.log('FORWARDING ENTRY IS PRESENT');
|
| 341 | if(LOG>3)console.log(forwardingEntry);
|
| 342 |
|
| 343 | ///////////////////////////////////////
|
| 344 |
|
| 345 | //var output ="";
|
| 346 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 347 | if(forwardingEntry.action!=null ){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 348 | output+= "Action: ";
|
| 349 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 350 | output+= DataUtils.toHex(forwardingEntry.action);
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 351 |
|
| 352 | output+= "<br />";
|
| 353 | output+= "<br />";
|
| 354 | }
|
| 355 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 356 | if(forwardingEntry.prefixName!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 357 | output+= "PrefixName: ";
|
| 358 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 359 | output+= forwardingEntry.prefixName.getName();
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 360 | output+= "<br />";
|
| 361 | }
|
| 362 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 363 | if(forwardingEntry.ccndID!=null){
|
| 364 | output+= "ccndID: ";
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 365 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 366 | output+= forwardingEntry.ccndID;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 367 | output+= "<br />";
|
| 368 | }
|
| 369 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 370 | if(forwardingEntry.flags!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 371 | output+= "Flags: ";
|
| 372 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 373 | output+= forwardingEntry.flags;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 374 | output+= "<br />";
|
| 375 | }
|
| 376 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 377 | if(forwardingEntry.lifetime!=null){
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 378 | output+= "Lifetime: ";
|
| 379 |
|
Jeff Thompson | e85ff1d | 2012-09-29 21:21:57 -0700 | [diff] [blame] | 380 | output+= forwardingEntry.lifetime;
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 381 | output+= "<br />";
|
| 382 | }
|
| 383 |
|
| 384 |
|
| 385 | }
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 | document.getElementById('result').innerHTML = output;
|
| 390 |
|
| 391 | }
|
| 392 |
|
| 393 | </script>
|
| 394 |
|
| 395 | </head>
|
| 396 | <body >
|
| 397 | <form>
|
| 398 |
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 399 | Please Press Decode:<br />
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 400 |
|
| 401 |
|
| 402 | </form>
|
| 403 | <button onclick="decode()">Decode</button>
|
| 404 |
|
| 405 | <!-- p id="result-old-from-ccnx">01d2f2faa563636e7800fa0285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f00fabd73656c6672656700fa1bf5048202aa03b208854a18988c72aee624da28e2e1acbccb209b8e89429041985521ed68f95a1c546872fba3d854b1377dc249b6d8ec5935e5069256c97a7f6d8a62e86222ccd2cfe5097aed3fe5ede6732ce191a8680d78e39d0c5058a2b7bb0f0687994e9f045de346b66c46498547a08da1f2f0cdfafba3afdfe7107931935ede79040137ba94a90000f20001a203e202851a4860caa4991e829bcdc9429fb711d52440968d23560726606050bf147acffc0002bab504fcb3f03aa40001e201da0a9530819f300d06092a864886f70d010101050003818d00308189028181008ed27580e3d1c4c67672208665133a1ba12d8ebf5cad8e054571926b3ff0782a04c71703384021a6cefb6616b66cbd8a679b761d69d6373a851546e26f7105510b4c23be9a3c7f2e652e100ecc1471855730659f1477ce4e8504ad1fd8f44116baaeae2ff67eec33abba790157a79bf5039e5a528a471d9d67c94e70117ed7490203010001000000019a0585058a04cabe73656c6672656700f2faad726f63636f000003e20285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f0004fa8e330003d2d63231343734383336343700000000000002d28e310000</p-->
|
| 406 |
|
| 407 | <p id="result">01d2f2faa563636e7800fa0285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f00facd70726566697872656700fa29ad048202aa03b208854ddbf69779cdf4ef74be99474478c8bc3ca0873e0ffa1fa60120aa276db122b83404e595a8a3caeaf09630276658ba4e7beaadb4b91a8cc58e19ac4a42289507ed8d609aa9bef61a5a507f349c83d2944b8c16fecfd90d4a40ddb8687592c0a57517564235b2e359db54f51a37e1ac39e518a2196e3ffda7eb2fb301f3c404dd0000f20001a203e20285ef7c4f5d4743a8b8586ea2e741b7fc39d1dc0dbe1b1930e787cfd1d833ea7a610002bab504fce9e253d70001e2018219fd3082019b30820104020900b7d85c906bad52ee300d06092a864886f70d010105050030123110300e060355040313076178656c636476301e170d3132303432383233343433375a170d3132303532383233343433375a30123110300e060355040313076178656c63647630819f300d06092a864886f70d010101050003818d0030818902818100e17d30a7d828ab1b840b17542dcaf6207afd221e086b2a60d16cb7f54448ba9f3f08bcd099db21dd162a779e61aa89eee554d3a47de230bc7ac590d524067c3898bba6f5dc4360b845eda48cbd9cf126a723445f0e1952d7325a75faf556144f9a98af7186b0278685b8e2c08bea87171b4dee585c1828295b5395eb4a17779f0203010001300d06092a864886f70d010105050003818100cb3ab0357d7cd2ae97ed501e51a3a0e2817d418e47fb17906477af61495a7e8d8789141065b082d001f4b15193d0b43fb661cde20a6498372c6abbd3dcb9f0d12659ef07b3c6dbdf8bdf2f65477eed7adcd457d793b1c27badda7c5ade80ce95b7d8827fe78c8a35f3fb4ba648a081be2cfe84231abab3c2b531746df2e0492b000000019a02d5058a04cabe73656c6672656700f2faa56d656b69000004fa8e330003d2d63231343734383336343700000000000002d28e310000</p>
|
| 408 |
|
| 409 | </body>
|
| 410 | </html> |