diff --git a/src/components/KeyDetails.vue b/src/components/KeyDetails.vue index 1dc0306..3e6d43d 100644 --- a/src/components/KeyDetails.vue +++ b/src/components/KeyDetails.vue @@ -1,16 +1,54 @@ - - - diff --git a/src/components/KeyInspector.vue b/src/components/KeyInspector.vue index 498ab6c..c48642f 100644 --- a/src/components/KeyInspector.vue +++ b/src/components/KeyInspector.vue @@ -15,7 +15,13 @@ > - +

Key Details

+
+

{{error}}

+
+
+ +
@@ -31,15 +37,19 @@ export default { }, data: () => ({ pubkey: "", - fingerprint: "" + keys: [], + error: "" }), methods: { inspect: async function() { - let keys = (await openpgp.key.readArmored(this.pubkey)).keys; - this.fingerprint = keys[0].getFingerprint(); + try { + this.keys = (await openpgp.key.readArmored(this.pubkey)).keys; + this.error = ""; + } catch (e) { + this.keys = []; + this.error = "Unable to parse the provided key"; + } } } }; - - diff --git a/src/main.js b/src/main.js index a21e528..7cdf717 100644 --- a/src/main.js +++ b/src/main.js @@ -1,10 +1,10 @@ -import Vue from 'vue' -import App from './App.vue' -import vuetify from './plugins/vuetify'; +import Vue from "vue"; +import App from "./App.vue"; +import vuetify from "./plugins/vuetify"; -Vue.config.productionTip = false +Vue.config.productionTip = false; new Vue({ vuetify, render: h => h(App) -}).$mount('#app') +}).$mount("#app");