finishing touches for x509/pgp store

master
Matthew 2021-07-03 23:05:09 -04:00
parent d82d8b68e4
commit 9f3da82454
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
2 changed files with 11 additions and 1 deletions

View File

@ -58,7 +58,7 @@ export default class Keys extends Route {
<p><strong>Common Name:</strong> ${x509.data.subject.commonName}</p> <p><strong>Common Name:</strong> ${x509.data.subject.commonName}</p>
<p><strong>Email Address:</strong> ${x509.data.emailAddresses[0]}</p> <p><strong>Email Address:</strong> ${x509.data.emailAddresses[0]}</p>
<p><strong>Expires on:</strong> ${x509.data.notAfter.toLocaleString('en-us')}</p> <p><strong>Expires on:</strong> ${new Date(x509.data.notAfter).toLocaleString('en-us')}</p>
<p><strong>Public Key Algorithm</strong> ${x509.data.publicKeyAlgorithm}</p> <p><strong>Public Key Algorithm</strong> ${x509.data.publicKeyAlgorithm}</p>
<p><strong>Key Bit Length</strong> ${x509.data.bitLength}</p> <p><strong>Key Bit Length</strong> ${x509.data.bitLength}</p>

View File

@ -3,6 +3,7 @@ import moment from 'moment';
import { Message, Member } from 'eris'; import { Message, Member } from 'eris';
import { Client, Command, RichEmbed } from '../class'; import { Client, Command, RichEmbed } from '../class';
import { whois as emotes } from '../configs/emotes.json'; import { whois as emotes } from '../configs/emotes.json';
import { profile } from '.';
export default class Whois extends Command { export default class Whois extends Command {
constructor(client: Client) { constructor(client: Client) {
@ -224,6 +225,15 @@ export default class Whois extends Command {
if (permissions.length > 0) { if (permissions.length > 0) {
embed.addField('Permissions', permissions.join(', ')); embed.addField('Permissions', permissions.join(', '));
} }
if (account.x509 || account.pgp) {
if (account.x509 && account.pgp) {
embed.addField('Credentials', `[PGP](https://comm.libraryofcode.org/keys/~/pgp/${member.id}) | [x509](https://comm.libraryofcode.org/keys/~/x509/${member.id})`);
} else if (account.pgp) {
embed.addField('Credentials', `[PGP](https://comm.libraryofcode.org/keys/~/pgp/${member.id})`);
} else if (account.x509) {
embed.addField('Credentials', `[x509](https://comm.libraryofcode.org/keys/~/x509/${member.id})`);
}
}
if (serverAcknowledgements.length > 0) { if (serverAcknowledgements.length > 0) {
embed.addField('Acknowledgements', serverAcknowledgements[0]); embed.addField('Acknowledgements', serverAcknowledgements[0]);
} }