Created
September 21, 2015 17:51
-
-
Save zhehaowang/0ae0fd10b88a2295376a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create-identity-test.html dbtestpage.html icn-cert-publisher.html | |
zhehao@memoria:/var/www/icn-tutorial/icn-tutorial-app/tests$ vi create-identity-test.html | |
zhehao@memoria:/var/www/icn-tutorial/icn-tutorial-app/tests$ vi create-identity-test.html | |
<?xml version = "1.0" encoding="utf-8" ?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"DTD/xhtml1-strict.dtd"> | |
<html xmlns = "http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Test Validate</title> | |
<script src="../js/ndn.min.js"></script> | |
<script type="text/javascript"> | |
var AppConfig = function AppConfig() | |
{ | |
this.host = "memoria.ndn.ucla.edu"; | |
var policyManager = new ConfigPolicyManager(); | |
this.identityStorage = new IndexedDbIdentityStorage(); | |
this.keyChain = new KeyChain | |
(new IdentityManager(this.identityStorage, new IndexedDbPrivateKeyStorage()), | |
policyManager); | |
this.keyChain.createIdentityAndCertificate | |
(new Name("/ndn/org/icn"), function(certificateName) { | |
console.log("Cert name " + certificateName.toUri()); | |
}, function(error) { | |
console.log("createIdentityCertificate Error: " + error); | |
}); | |
}; | |
function doServe() | |
{ | |
var appConfig = new AppConfig(); | |
} | |
</script> | |
</head> | |
<body > | |
Code from Jeff T's sample tutorial app with minimal change | |
<p>Click to call createIdentityAndCertificate, please open JS console.</p> | |
<button onclick="doServe()">Serve ICN root cert</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment