Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -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 Request Example</title>
|
| 8 | <script type="text/javascript" src="java_socket_bridge.js"></script>
|
| 9 |
|
| 10 | <script type="text/javascript" src="CCNProtocolDTags.js"></script>
|
| 11 |
|
| 12 | <script type="text/javascript" src="CCNTime.js"></script>
|
| 13 |
|
| 14 | <script type="text/javascript" src="ContentName.js"></script>
|
| 15 |
|
| 16 | <script type="text/javascript" src="ContentObject.js"></script>
|
| 17 |
|
| 18 | <script type="text/javascript" src="DateFormat.js"></script>
|
| 19 |
|
| 20 | <script type="text/javascript" src="Exclude.js"></script>
|
| 21 |
|
| 22 | <script type="text/javascript" src="ExcludeAny.js"></script>
|
| 23 |
|
| 24 | <script type="text/javascript" src="ExcludeComponent.js"></script>
|
| 25 |
|
| 26 | <script type="text/javascript" src="Interest.js"></script>
|
| 27 |
|
| 28 | <script type="text/javascript" src="KeyLocator.js"></script>
|
| 29 |
|
| 30 | <script type="text/javascript" src="KeyName.js"></script>
|
| 31 |
|
| 32 | <script type="text/javascript" src="PublisherID.js"></script>
|
| 33 |
|
| 34 | <script type="text/javascript" src="Signature.js"></script>
|
| 35 |
|
| 36 | <script type="text/javascript" src="SignedInfo.js"></script>
|
| 37 |
|
| 38 | <script type="text/javascript" src="PublisherPublicKeyDigest.js"></script>
|
| 39 |
|
Meki Cherkaoui | abb973b | 2012-05-09 14:25:57 -0700 | [diff] [blame] | 40 | <script type="text/javascript" src="FaceInstance.js"></script>
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 41 |
|
Meki Cherkaoui | abb973b | 2012-05-09 14:25:57 -0700 | [diff] [blame] | 42 | <script type="text/javascript" src="ForwardingEntry.js"></script>
|
| 43 |
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 44 | <script type="text/javascript" src="encoding/BinaryXMLEncoder.js"></script>
|
| 45 |
|
| 46 | <script type="text/javascript" src="encoding/BinaryXMLCodec.js"></script>
|
| 47 |
|
| 48 | <script type="text/javascript" src="encoding/BinaryXMLDecoder.js"></script>
|
| 49 |
|
| 50 | <script type="text/javascript" src="encoding/DataUtils.js"></script>
|
| 51 |
|
Meki Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -0700 | [diff] [blame^] | 52 | <script language="JavaScript" type="text/javascript" src="security/KeyManager.js"></script>
|
| 53 |
|
| 54 | <script language="JavaScript" type="text/javascript" src="securityLib/jsbn.js"></script>
|
| 55 | <script language="JavaScript" type="text/javascript" src="securityLib/jsbn2.js"></script>
|
| 56 | <script language="JavaScript" type="text/javascript" src="securityLib/rsa.js"></script>
|
| 57 | <script language="JavaScript" type="text/javascript" src="securityLib/rsa2.js"></script>
|
| 58 |
|
| 59 | <script language="JavaScript" type="text/javascript" src="securityLib/sha1.js"></script>
|
| 60 | <script language="JavaScript" type="text/javascript" src="securityLib/sha256.js"></script>
|
| 61 | <script language="JavaScript" type="text/javascript" src="securityLib/sha512.js"></script>
|
| 62 | <script language="JavaScript" type="text/javascript" src="securityLib/md5.js"></script>
|
| 63 | <script language="JavaScript" type="text/javascript" src="securityLib/ripemd160.js"></script>
|
| 64 | <script language="JavaScript" type="text/javascript" src="securityLib/base64.js"></script>
|
| 65 |
|
| 66 | <script language="JavaScript" type="text/javascript" src="securityLib/rsapem-1.1.js"></script>
|
| 67 | <script language="JavaScript" type="text/javascript" src="securityLib/rsasign-1.2.js"></script>
|
| 68 | <script language="JavaScript" type="text/javascript" src="securityLib/asn1hex-1.1.js"></script>
|
| 69 | <script language="JavaScript" type="text/javascript" src="securityLib/x509-1.1.js"></script>
|
| 70 |
|
| 71 |
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 72 | <script type="text/javascript">
|
| 73 | function run(){
|
| 74 |
|
| 75 | var ContentName = document.getElementById('contentname').value;
|
| 76 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 77 | var Content = document.getElementById('content').value;
|
| 78 |
|
Meki Cherkaoui | abb973b | 2012-05-09 14:25:57 -0700 | [diff] [blame] | 79 | //createRoute('borges.metwi.ucla.edu', 9695);
|
| 80 |
|
| 81 | createRoute('localhost', 9695);
|
| 82 |
|
| 83 | registerPrefix(ContentName, Content);
|
| 84 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 85 |
|
| 86 |
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 87 | ///////////////////////////////////////
|
| 88 | //createRoute('localhost', 9695);
|
| 89 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 90 | //createRoute('131.179.141.15', 9695);
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 91 | //createRoute('borges.metwi.ucla.edu', 9695);
|
| 92 |
|
| 93 | //content object
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 94 | //var co = queryPrefix( ContentName );
|
| 95 |
|
| 96 |
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 97 |
|
| 98 | ///////////////////////////////////////
|
| 99 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 100 | /*var output ="";
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 101 |
|
| 102 | if(co==-1)
|
| 103 | output+= "NO CONTENT FOUND"
|
| 104 | else if (co==-2)
|
| 105 | output+= "CONTENT NAME IS EMPTY"
|
| 106 | else{
|
| 107 | if(co.Name!=null && co.Name.Components!=null){
|
| 108 | output+= "NAME: ";
|
| 109 |
|
| 110 | for(var i=0;i<co.Name.Components.length;i++){
|
| 111 | output+= "/"+ toString(co.Name.Components[i]);
|
| 112 | }
|
| 113 | output+= "<br />";
|
| 114 | output+= "<br />";
|
| 115 | }
|
| 116 |
|
| 117 | if(co.Content !=null){
|
| 118 | output += "CONTENT(ASCII): "+ toString(co.Content);
|
| 119 |
|
| 120 | output+= "<br />";
|
| 121 | output+= "<br />";
|
| 122 | }
|
| 123 | if(co.Content !=null){
|
| 124 | output += "CONTENT(hex): "+ toHex(co.Content);
|
| 125 |
|
| 126 | output+= "<br />";
|
| 127 | output+= "<br />";
|
| 128 | }
|
| 129 | if(co.Signature !=null && co.Signature.Signature!=null){
|
| 130 |
|
| 131 | output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
|
| 132 |
|
| 133 | output+= "<br />";
|
| 134 | output+= "<br />";
|
| 135 | }
|
| 136 | if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Key!=null){
|
| 137 |
|
| 138 | output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
|
| 139 |
|
| 140 | output+= "<br />";
|
| 141 | output+= "<br />";
|
| 142 |
|
| 143 | }
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 144 | }*/
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 145 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 146 | //document.getElementById('result').innerHTML = output;
|
| 147 | document.getElementById('result').innerHTML = 'Content \'' + Content + '\' was published with content name \'' + ContentName +'\'';
|
| 148 |
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 149 | }
|
| 150 |
|
| 151 | </script>
|
| 152 |
|
| 153 | </head>
|
| 154 | <body >
|
| 155 | <form>
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 156 |
|
| 157 | Please Enter a Content Name:<br />
|
| 158 |
|
| 159 | <input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" />
|
| 160 |
|
| 161 | Please Enter the Content:<br />
|
| 162 |
|
| 163 | <textarea id="content" cols="40" rows="5" name="CONTENT" value="SUCCESS" >SUCCESS!</textarea>
|
| 164 |
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 165 | <br />
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 166 | </form>
|
Meki Cherkaoui | 09c1557 | 2012-04-28 14:42:18 -0700 | [diff] [blame] | 167 | <button onclick="run()">Publish</button>
|
Meki Cherkaoui | f441d3a | 2012-04-22 15:17:52 -0700 | [diff] [blame] | 168 | <div >
|
| 169 | <applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
|
| 170 | </applet>
|
| 171 | </div>
|
| 172 |
|
| 173 | <p id="result"></p>
|
| 174 |
|
| 175 | </body>
|
| 176 | </html> |