forked from Mirrors/keyoxide-web
Improve fetchKeys function
This commit is contained in:
parent
51110408b1
commit
ae89964feb
1 changed files with 4 additions and 1 deletions
|
@ -133,6 +133,7 @@ async function encryptMessage(opts) {
|
|||
};
|
||||
|
||||
async function fetchKeys(opts) {
|
||||
// Init
|
||||
let lookupOpts, wkd, hkd, sig, lastPrimarySig;
|
||||
let output = {
|
||||
publicKey: null,
|
||||
|
@ -143,6 +144,7 @@ async function fetchKeys(opts) {
|
|||
sigContent: null
|
||||
};
|
||||
|
||||
// Fetch keys depending on the input mode
|
||||
switch (opts.mode) {
|
||||
case "plaintext":
|
||||
output.publicKey = (await openpgp.key.readArmored(opts.input)).keys[0];
|
||||
|
@ -201,7 +203,8 @@ async function fetchKeys(opts) {
|
|||
break;
|
||||
}
|
||||
|
||||
output.fingerprint = output.publicKey.primaryKey.getFingerprint();
|
||||
// Gather more data about the primary key and user
|
||||
output.fingerprint = await output.publicKey.primaryKey.getFingerprint();
|
||||
output.user = await output.publicKey.getPrimaryUser();
|
||||
lastPrimarySig = output.user.selfCertification;
|
||||
output.notations = lastPrimarySig.notations || [];
|
||||
|
|
Loading…
Reference in a new issue