From 73f5a4323fba3d77ce86ce0e627b830b98a9438a Mon Sep 17 00:00:00 2001 From: Patrick Roumanoff Date: Fri, 4 Sep 2015 10:48:05 +1000 Subject: [PATCH] css and favico --- index.html | 23 ++++++++++++++--------- js-keygen-ui.js | 4 ++++ js-keygen.css | 27 +++++++++++++++++++++++++++ key.png | Bin 0 -> 1962 bytes 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 key.png diff --git a/index.html b/index.html index 63c5814..54dedda 100644 --- a/index.html +++ b/index.html @@ -6,9 +6,11 @@ - + + +

js-keygen

Generate a keypair to be used with openSSH, this replicate ssh-keygen function in javascript in the browser, using the webcrypto api and a bit of glue.
@@ -38,17 +40,20 @@
-
- - - Private Key or
- +
Made with by Patrick Roumanoff Fork me on GitHub +
\ No newline at end of file diff --git a/js-keygen-ui.js b/js-keygen-ui.js index ac5c213..9c651da 100644 --- a/js-keygen-ui.js +++ b/js-keygen-ui.js @@ -31,6 +31,9 @@ document.addEventListener("DOMContentLoaded", function(event) { document.querySelector('#generate').addEventListener('click', function(event) { var name = document.querySelector('#name').value || "name"; + document.querySelector('a#private').setAttribute("download", name + "_rsa"); + document.querySelector('a#public').setAttribute("download", name + "_rsa.pub"); + var alg = document.querySelector('#alg').value || "RSASSA-PKCS1-v1_5"; var size = parseInt(document.querySelector('#size').value || "2048"); generateKeyPair(alg, size, name).then(function (keys) { @@ -38,6 +41,7 @@ document.addEventListener("DOMContentLoaded", function(event) { document.querySelector('#public').setAttribute("href", buildHref(keys[1])); document.querySelector('#privateKey').textContent = keys[0]; document.querySelector('#publicKey').textContent = keys[1]; + document.querySelector('#result').style.display = "block"; }).catch(function(err){ console.error(err); }); diff --git a/js-keygen.css b/js-keygen.css index eada212..a562df0 100644 --- a/js-keygen.css +++ b/js-keygen.css @@ -1,3 +1,30 @@ +body { + background-color: #cccccc; + font: 16px Arial, Tahoma, Helvetica, FreeSans, sans-serif; +} + +button#generate { + background-color: rgb(60,200,30); + padding: 10px; + margin-top: 5px; + color: white; + font-weight: bold; + font-size: 1.1em; + border-radius: 8px; + border-width: 0px; + margin-right: 20px; + margin-left: 20px; + min-width: 120px; +} + +div#content { + background-color: #f0f0f0; + border-radius: 8px; + width: 780px; + margin: auto; + padding: 20px; +} + label { display: inline-block; width: 80px; diff --git a/key.png b/key.png new file mode 100644 index 0000000000000000000000000000000000000000..426621763a92af34fbd65241d840fbb73c1c5c4e GIT binary patch literal 1962 zcmV;b2UYlqP)s_CKT^|_V_S#^Mnm}xV zah%Xl89^zft%wu#$cKnFN)#z=+7D6r5TVFzq>84_K|oEQN{N!RV3P(zjSa>Jc5IA~ z^;NIEhxeGBncbOwu-7ugiGf>yw{EGxCoAfS zKJP!zjtWQGXM&Tfd_GM9Aor!|YF^5-yjgDL67E%KD1xYn*QR@A zsONG_C##cn8PTkysOa~~VFN>wG)Vve%Hp`RX+cH1E7Y`_0AxkHrh4C6eOWZ~kt5Jk zcWLsOlE05;?YlJflheb28vwwP1S*rcI?UgiRSUYvs|J;}QDyOQ{)KAZ5rzghsKg(ED{#r0XS@BDY({~G`R+2Izi3K7*E)Uasc80RSl1X2j2?h474^;5+FC#>y-h5CF8zinGVsW>2^zg()^`QV0UD zaFnJhNnaYz)72EMPV{=@{)YiroCN?Vdy#H;jE-KX3@db&p0)}~gro_~4SSVOo1KA< zctHQdyx4|gxuyd)j$)#_-1bR+-Tq_ z;(C|hI`a?L>y00}UR|#0KpOvx`YhuM+Y_`&(VPn4Z^QoXvkw0&r|$SaxL*JY0D1T+ z^Pi6%h}$WLK@1Fqgq$ocCO3;KA0C&w?uMo;UiwiyodJf$6RNLNQDq>-9OW1l(rq`Agqq-Pr%oee9r5#1iC zbySEn`(>q|bm5UKbc5cJs4K9t?2`&eZ=ZL5rrZTE;|foiV`=*nRmS3+Om1&^3BUi) z_hR?QnP^6o6hklsOGi(z87q8<4Ef~AYvaMwld_Umm84rAy~PB80uyW9Y}HhAG?_Uj z3C&BoG4BK3kn(RyRP8&r8nSb`PYm$wrA_(=);D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