Skip to content

Introduce a per-user certificate inventory and migrate legacy PFX storage #9474

Open

Description

@vitormattos

Goal

Introduce a persistent inventory capable of representing multiple signing certificates per Nextcloud account, while preserving all existing reusable PFX certificates.

Current state

SignEngineHandler uses a single signature.pfx filename. Certificate creation, lookup and deletion assume one reusable certificate per account.

Scope

  • Introduce individual certificate records with stable identifiers and strict account ownership.
  • Store certificate metadata separately from protected PKCS#12 material.
  • Include issuer reference, subject, serial number, SHA-256 fingerprint, validity period, source, status and optional organizational context where applicable.
  • Support multiple inventory records for the same user without requiring multiple CAs.
  • Define a storage reference that does not expose private certificate material.
  • Migrate existing signature.pfx files idempotently, preserving their contents and password protection.
  • Retain compatibility with existing certificate lookup and signing paths during migration.
  • Establish backend contracts for later certificate-specific operations and UI development.
  • Avoid assuming that every certificate is LibreSign-issued or belongs to a Nextcloud group.

Acceptance criteria

  • Existing certificates are discoverable through the inventory without reissuance.
  • Two certificates belonging to one account have distinct records and protected storage references.
  • An account cannot retrieve another account's certificate material.
  • Repeated migration does not create duplicate records, overwrite PFX files or revoke certificates.
  • Listing certificate metadata does not require reading every PFX.
  • Missing files and inconsistent legacy records produce safe, recoverable behavior.
  • Tests cover ownership, migration, duplicate detection, storage failures and legacy signing compatibility.
  • The backend data contract and migration behavior are documented.

Out of scope

The complete CRUD UI, policy-based CA selection, certificate delegation, cloud certificates and interactive signing selection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend workenhancementApp improvimentsphpWork involving PHP code

    Type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions