From 91435453895b7c09d9e15f7bfd10b19226b1e591 Mon Sep 17 00:00:00 2001 From: John Shaver Date: Tue, 21 Aug 2018 14:15:09 -0700 Subject: [PATCH] Added download links for certs and changed some formatting. --- app/index.html | 21 ++++++++++++++++++--- app/js/app.js | 4 ++++ app/styles/main.css | 9 +++++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/app/index.html b/app/index.html index bcb2f33..bed0ed6 100644 --- a/app/index.html +++ b/app/index.html @@ -184,7 +184,7 @@
...loading
-
+
@@ -259,20 +259,35 @@
-
+

               
+
+ + + + + Download + +

               
- +
+ + + + + Download + +

node.js https server example

'use strict';
diff --git a/app/js/app.js b/app/js/app.js
index de8c908..5cf45a5 100644
--- a/app/js/app.js
+++ b/app/js/app.js
@@ -471,6 +471,8 @@
         console.log('WINNING!');
         console.log(certs);
         $qs('#js-fullchain').innerHTML = certs;
+        $qs("#js-download-fullchain-link").href =
+          "data:text/octet-stream;base64," + window.btoa(certs);
 
         // https://stackoverflow.com/questions/40314257/export-webcrypto-key-to-pem-format
 				function spkiToPEM(keydata){
@@ -530,6 +532,8 @@
 				}).then (function (keydata) {
 					var pem = spkiToPEM(keydata);
 					$qs('#js-privkey').innerHTML = pem;
+          $qs("#js-download-privkey-link").href =
+            "data:text/octet-stream;base64," + window.btoa(pem);
           steps[i]();
 				}).catch(function(err){
 					console.error(err);
diff --git a/app/styles/main.css b/app/styles/main.css
index 934cbd3..6fd048d 100644
--- a/app/styles/main.css
+++ b/app/styles/main.css
@@ -191,12 +191,12 @@ pre {
     display: none;
 }
 
-.download-ver-file svg {
+.download-file svg {
     fill: #5bc17f;
     width: 1.333333333em;
 }
 
-.download-ver-file a {
+.download-file a {
     color: #5bc17f;
 }
 
@@ -250,3 +250,8 @@ pre {
     white-space: pre-line;
     word-break: break-all;
 }
+
+
+.cert-download-container {
+    margin: 0 -31%;
+}
\ No newline at end of file