Core: - paths.py: centralized ~/.soosef/ path constants - config.py: JSON config loader with dataclass defaults - exceptions.py: SoosefError hierarchy - cli.py: unified Click CLI wrapping stegasoo + verisoo + native commands Keystore: - manager.py: unified key management (Ed25519 identity + channel keys) - models.py: IdentityInfo, KeystoreStatus dataclasses - export.py: encrypted key bundle export/import for USB transfer Fieldkit: - killswitch.py: ordered emergency data destruction (keys first) - deadman.py: dead man's switch with check-in timer - tamper.py: SHA-256 file integrity baseline + checking - usb_monitor.py: pyudev USB whitelist enforcement - geofence.py: haversine-based GPS boundary checking Web frontend (Flask app factory + blueprints): - app.py: create_app() factory with context processor - blueprints: stego, attest, fieldkit, keys, admin - templates: base.html (dark theme, unified nav), dashboard, all section pages - static: CSS, favicon Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
"""
|
|
Key management blueprint — unified view of all key material.
|
|
"""
|
|
|
|
from flask import Blueprint, flash, redirect, render_template, request, url_for
|
|
|
|
bp = Blueprint("keys", __name__, url_prefix="/keys")
|
|
|
|
|
|
@bp.route("/")
|
|
def index():
|
|
"""Key management dashboard."""
|
|
from soosef.keystore import KeystoreManager
|
|
|
|
ks = KeystoreManager()
|
|
return render_template("fieldkit/keys.html", keystore=ks.status())
|
|
|
|
|
|
@bp.route("/channel/generate", methods=["POST"])
|
|
def generate_channel():
|
|
"""Generate a new channel key."""
|
|
from soosef.keystore import KeystoreManager
|
|
|
|
ks = KeystoreManager()
|
|
key = ks.generate_channel_key()
|
|
flash(f"Channel key generated: {key[:8]}...", "success")
|
|
return redirect(url_for("keys.index"))
|
|
|
|
|
|
@bp.route("/identity/generate", methods=["POST"])
|
|
def generate_identity():
|
|
"""Generate a new Ed25519 identity."""
|
|
from soosef.keystore import KeystoreManager
|
|
|
|
ks = KeystoreManager()
|
|
info = ks.generate_identity()
|
|
flash(f"Identity generated: {info.fingerprint[:16]}...", "success")
|
|
return redirect(url_for("keys.index"))
|