Files
go-pgp-generator/templates/result.html
2025-09-22 20:48:52 +02:00

68 lines
2.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>PGP Schlüssel Ergebnis</title>
<style>
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Inter,sans-serif;max-width:960px;margin:2rem auto;padding:0 1rem;color:#0f172a}
.card{border:1px solid #e2e8f0;border-radius:14px;padding:1rem 1.25rem;box-shadow:0 1px 2px rgba(0,0,0,0.04);margin-bottom:1rem}
textarea{width:100%;min-height:12rem;border-radius:10px;border:1px solid #cbd5e1;padding:.6rem .7rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.row{display:flex;gap:.75rem;flex-wrap:wrap}
button{background:#0ea5e9;color:white;border:none;border-radius:12px;padding:.6rem .8rem;font-weight:600;cursor:pointer}
button:hover{background:#0284c7}
.muted{color:#64748b}
</style>
</head>
<body>
<header style="display:flex;justify-content:space-between;align-items:center">
<h1>✅ Schlüssel erzeugt</h1>
<a href="/">Neuen Schlüssel erzeugen</a>
</header>
<div class="card">
<div><strong>Fingerprint:</strong> {{.Fingerprint}}</div>
<div><strong>Erstellt:</strong> {{.Created.Format "2006-01-02 15:04:05"}}</div>
<div class="muted">User ID im Schlüssel: {{if .UIDOnKey}}{{.UIDOnKey}}{{else}}{{.Name}} &lt;{{.Email}}&gt;{{end}} • RSA {{.RSABits}}</div>
{{if .Comment}}
<div class="muted">Kommentar (nur Anzeige, nicht in UID eingebettet): {{.Comment}}</div>
{{end}}
</div>
<div class="card">
<h2>Öffentlicher Schlüssel</h2>
<textarea id="pub" readonly>{{.PublicArmored}}</textarea>
<div class="row" style="margin-top:.5rem">
<button onclick="copy('#pub')">Kopieren</button>
<button onclick="download('#pub','public.asc')">Als Datei speichern</button>
</div>
</div>
<div class="card">
<h2>Privater Schlüssel (geheim halten!)</h2>
<textarea id="priv" readonly>{{.PrivateArmored}}</textarea>
<div class="row" style="margin-top:.5rem">
<button onclick="copy('#priv')">Kopieren</button>
<button onclick="download('#priv','private.asc')">Als Datei speichern</button>
</div>
<p class="muted">Verwahren Sie den privaten Schlüssel sicher. Teilen Sie ihn niemals.</p>
</div>
<script>
async function copy(sel){
const el=document.querySelector(sel);
el.select(); el.setSelectionRange(0, 999999);
await navigator.clipboard.writeText(el.value);
alert('In die Zwischenablage kopiert.');
}
function download(sel, filename){
const text = document.querySelector(sel).value;
const blob = new Blob([text], {type:'text/plain'});
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url; a.download = filename; a.click();
URL.revokeObjectURL(url);
}
</script>
</body>
</html>