Files
mumh5/electron/certs.ts
T
kibiandClaude Opus 5.5 6d29ee1485 Initial commit: mumh5, a modern Mumble client
Electron desktop app with a Svelte 5 interface for any Mumble server.

- Mumble protocol core: TLS, handshake, channels, users, text, plugin data,
  client-side pacing of Murmur's rate limits
- Voice: WebCodecs Opus over the TCP tunnel, voice activity, push to talk,
  always-on, devices, per-user volume and local mute
- Several servers at once, voice on one; server rail with icons and ordering
- Chat: channels, direct messages, side chat, file sharing through f0ckm,
  inline images without it, click-to-play YouTube
- Profiles with rich descriptions, registration, rename, nicknames,
  connection information and moderation menus
- Identity wizard, multiple identities, PKCS#12 import/export, desktop
  Mumble certificate import, certificate pinning and viewer
- Tray icon with voice state
- Unit, server and end-to-end tests against a real Murmur

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 23:28:43 +02:00

40 lines
1.1 KiB
TypeScript

import { X509Certificate } from 'node:crypto';
export interface CertDetails {
subject: string;
issuer: string;
validFrom: string;
validTo: string;
serialNumber: string;
fingerprint: string; // SHA-1, the hash Mumble uses for users
fingerprint256: string;
subjectAltName: string;
keyType: string;
keyBits: number | null;
ca: boolean;
selfSigned: boolean;
pem: string;
}
// Plain, IPC-safe summary of a certificate for the viewer
export function describeCert(input: string | Buffer | X509Certificate): CertDetails {
const c = input instanceof X509Certificate ? input : new X509Certificate(input);
const key = c.publicKey;
const d = key.asymmetricKeyDetails;
return {
subject: c.subject,
issuer: c.issuer,
validFrom: new Date(c.validFrom).toISOString(),
validTo: new Date(c.validTo).toISOString(),
serialNumber: c.serialNumber,
fingerprint: c.fingerprint,
fingerprint256: c.fingerprint256,
subjectAltName: c.subjectAltName ?? '',
keyType: key.asymmetricKeyType ?? 'unknown',
keyBits: d?.modulusLength ?? null,
ca: c.ca,
selfSigned: c.checkIssued(c),
pem: c.toString()
};
}