Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7327ca9
Planning phase
kwart Mar 28, 2026
64069fe
JFX UI
kwart Mar 28, 2026
d445e6b
icons
kwart Mar 28, 2026
687b726
Improvements
kwart Mar 28, 2026
d16bfd8
Fixes
kwart Mar 28, 2026
53cb95c
Store/reload position
kwart Mar 29, 2026
480e8c6
GUI fixes
kwart Mar 29, 2026
0f0620d
Fail-fast (PKInfo NPE)
kwart Mar 29, 2026
b2d34e6
Translation tests
kwart Mar 30, 2026
2bf8b90
Update ChangeLog for JavaFX GUI reimplementation
kwart Mar 30, 2026
c17b527
AGENTS.md and design-docs
kwart Mar 30, 2026
8cba1f3
normalize rectangle
kwart Apr 4, 2026
166e9b2
fix
kwart Apr 4, 2026
79d9348
version update
kwart Apr 4, 2026
873d191
BasicSignerOptions improvements
kwart Apr 4, 2026
0a230a6
Confirm visible signature replacement
kwart Apr 4, 2026
1e5e219
Revert "Confirm visible signature replacement"
kwart Apr 4, 2026
9a88fa5
Replacing visible signature with Shift key
kwart Apr 4, 2026
19835e0
openjfx-monocle version compatible with Java 11
kwart Apr 5, 2026
25c793d
extend comment
kwart Apr 6, 2026
19f672f
Don't duplicate Sign menu item
kwart Apr 6, 2026
cf08e4c
Wire up the Recent files menu and use PropertyProvider as the storage
kwart Apr 7, 2026
8b282d7
Sig overflow fix
kwart Apr 7, 2026
dc16007
Don't restore last session; Fix NPE when empty password is stored
kwart Apr 7, 2026
12f3f8b
fix mnemonic
kwart Apr 7, 2026
eaa2c5c
Add missing translations
kwart Apr 7, 2026
3453a5d
Update Windows installer - add Swing UI launcher
kwart Apr 7, 2026
7bf79a2
Remove review doc
kwart Apr 7, 2026
a2b55ec
dev
kwart Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# AGENTS.md - JSignPdf

## Project Overview

JSignPdf is a Java application for adding digital signatures to PDF documents. It provides both a GUI (JavaFX default, Swing fallback via `-Djsignpdf.swing=true`) and a CLI interface.

- **Java**: 11+
- **Build**: Apache Maven multi-module
- **Repository**: https://github.com/intoolswetrust/jsignpdf

## Build Commands

```bash
mvn clean install # Build everything (with tests)
mvn clean install -DskipTests # Build without tests
mvn test -Dtest=BasicSigningTest # Run a single test class
```

## Module Structure

```
jsignpdf-root/
├── jsignpdf/ # Main application (signing logic + GUI + CLI)
├── installcert/ # Certificate installer utility
├── distribution/ # Packaging: ZIP assembly, Windows installer, docs
└── website/ # Docusaurus documentation site (not a Maven module)
```

## Source Code Layout

All source is under `jsignpdf/src/main/java/net/sf/jsignpdf/`:

```
net.sf.jsignpdf
├── Signer.java # Entry point - launches CLI or GUI
├── SignerLogic.java # Core signing engine (no UI dependencies)
├── BasicSignerOptions.java # Central model for all signing configuration
├── SignPdfForm.java # Swing GUI (legacy, .form files are IDE-generated)
├── fx/ # JavaFX GUI (default)
│ ├── JSignPdfApp.java # Application entry point
│ ├── FxLauncher.java # Static launcher called from Signer.main()
│ ├── view/ # FXML files + controllers (MainWindow, settings panels)
│ ├── viewmodel/ # DocumentViewModel, SigningOptionsViewModel, SignaturePlacementViewModel
│ ├── service/ # PdfRenderService, SigningService, KeyStoreService
│ ├── control/ # PdfPageView, SignatureOverlay
│ └── util/ # FxResourceProvider, SwingFxImageConverter, RecentFilesManager
├── crl/ # Certificate Revocation List handling
├── extcsp/ # External crypto providers (CloudFoxy)
├── preview/ # PDF page rendering (Pdf2Image)
├── ssl/ # SSL/TLS initialization
├── types/ # Enums and value types
└── utils/ # KeyStoreUtils, ResourceProvider, PropertyProvider, etc.
```

## Architecture

```
CLI (SignerOptionsFromCmdLine) ──┐
├──> BasicSignerOptions ──> SignerLogic.signFile()
GUI (JavaFX / Swing) ──┘ (model) (signing engine)
```

- **`BasicSignerOptions`** is the central model. Both CLI and GUI populate it, then pass it to `SignerLogic`.
- **`SignerLogic`** is the signing engine. It has no UI dependencies.
- **JavaFX GUI** uses MVVM: ViewModels with JavaFX properties, FXML views with `%key` i18n, background services wrapping `SignerLogic` and `Pdf2Image`.

### i18n

- Resource bundles: `net/sf/jsignpdf/translations/messages*.properties`
- CLI keys: `console.*`, `hlp.*`
- Swing keys: `gui.*`
- JavaFX keys: `jfx.gui.*`

### Configuration

- **User settings**: `~/.JSignPdf` (properties file, passwords encrypted per-user)
- **App config**: `conf/conf.properties`

## Testing

- **JUnit 4** - test sources under `jsignpdf/src/test/java/`
- **Signing tests** (`signing/` package): use `SigningTestBase` which creates temp PDFs dynamically
- **JavaFX UI tests** (`fx/FxTranslationsTest`): headless via Monocle, loads FXML with different locales and verifies node text

## CI/CD (GitHub Actions)

| Workflow | Trigger | Purpose |
|---|---|---|
| `pr-builder.yaml` | PR/push to master | `mvn verify` with Java 11 |
| `push-snapshots.yaml` | Push to master | Deploy SNAPSHOTs to Maven Central |
| `do-release.yml` | Manual dispatch | Full release |
Loading