Meki Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -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 language="JavaScript" type="text/javascript" src="securityLib/jsbn.js"></script>
|
| 9 | <script language="JavaScript" type="text/javascript" src="securityLib/jsbn2.js"></script>
|
| 10 | <script language="JavaScript" type="text/javascript" src="securityLib/rsa.js"></script>
|
| 11 | <script language="JavaScript" type="text/javascript" src="securityLib/rsa2.js"></script>
|
| 12 |
|
| 13 | <script language="JavaScript" type="text/javascript" src="securityLib/sha1.js"></script>
|
| 14 | <script language="JavaScript" type="text/javascript" src="securityLib/sha256.js"></script>
|
| 15 | <script language="JavaScript" type="text/javascript" src="securityLib/sha512.js"></script>
|
| 16 | <script language="JavaScript" type="text/javascript" src="securityLib/md5.js"></script>
|
| 17 | <script language="JavaScript" type="text/javascript" src="securityLib/ripemd160.js"></script>
|
| 18 | <script language="JavaScript" type="text/javascript" src="securityLib/base64.js"></script>
|
| 19 |
|
| 20 | <script language="JavaScript" type="text/javascript" src="securityLib/rsapem-1.1.min.js"></script>
|
| 21 | <script language="JavaScript" type="text/javascript" src="securityLib/rsasign-1.2.min.js"></script>
|
| 22 | <script language="JavaScript" type="text/javascript" src="securityLib/asn1hex-1.1.min.js"></script>
|
| 23 | <script language="JavaScript" type="text/javascript" src="securityLib/x509-1.1.min.js"></script>
|
| 24 |
|
| 25 |
|
| 26 | <script type="text/javascript">
|
| 27 | function hash(){
|
| 28 |
|
| 29 | var input = document.getElementById('contentname').value;
|
| 30 |
|
| 31 | var output = hex_sha256(input);
|
| 32 |
|
| 33 | document.getElementById('result').innerHTML = output;
|
| 34 |
|
| 35 | }
|
| 36 |
|
| 37 | </script>
|
| 38 |
|
| 39 |
|
| 40 | </head>
|
| 41 | <body >
|
| 42 | <form>
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 | Please Enter a Text to sign:<br /><input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> <br />
|
| 47 |
|
| 48 | </form>
|
| 49 | <button onclick="hash()">Hash</button>
|
| 50 |
|
| 51 | <p id="result"></p>
|
| 52 |
|
| 53 | </body>
|
| 54 | </html> |