28 Commits

Author SHA1 Message Date
adfa0b4b51 feat: add universal AsyncBus infrastructure
Introduce a generic asynchronous bus used for internal PKI workflows,
with resilient sweep support and symmetric primitive/wrapper type
compatibility for dispatch handling.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2026-01-02 22:28:53 +01:00
e01d95f48e chore: PMD 1.20.0 adaptation
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2026-01-01 11:44:13 +01:00
969a846d95 fix: proxy object might be returned
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2026-01-01 11:42:13 +01:00
d2ec77b8e3 feat: introduce SignatureWorkflow SPI and zeroecho-lib implementation
- add SignatureWorkflow SPI for asynchronous sign/verify operations
- define audit-friendly, exception-free failure model
- introduce stable OperationStatus, State and OperationResult semantics
- document trust boundaries, lifecycle, and audit constraints in SPI
  JavaDoc
- add ZeroEchoLibSignatureWorkflow backed by KeyringStore and ZeroEcho
  lib
- enforce opaque KeyRef handling and provider-local parsing
- add deterministic detail codes and UNKNOWN_OPERATION handling
- integrate workflow provider into ServiceLoader bootstrap
- align PkiBootstrap logging and defaults with crypto workflow SPI
- add comprehensive JUnit tests for validation and status semantics

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-29 22:41:11 +01:00
0346c5b30f feat: refactor SPI/bootstrap to generic configurable providers
- Introduce a universal ConfigurableProvider/ProviderConfig abstraction
  for ServiceLoader-based components and align PKI bootstrapping
  utilities with it.
- Document deterministic provider selection, property-based
  configuration conventions, and security requirements (never log config
  values), including package-level documentation for spi, spi.store and
  spi.bootstrap.

fix: harden audit runtime, fix gzip scanning, add bounds and docs

- Fix FileAuditSink concatenated gzip scan by shielding underlying
  stream
- Use JUnit @TempDir for filesystem-backed tests
- Bound InMemoryAuditSink with deterministic ring buffer
- Add ServiceLoader smoke test and expand DefaultAuditService coverage
- Improve JavaDoc and logging across audit implementation

feat: add deterministic tests for PkiBootstrap with real SPI providers

- add JUnit 5 test suite for PkiBootstrap
- cover SPI selection for filesystem PkiStore and audit sinks
- use @TempDir for filesystem-backed providers
- register test ServiceLoader providers under src/test/resources
- ensure deterministic bootstrap behavior via system properties

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-29 02:09:07 +01:00
cab1eeefe7 feat: add filesystem-based PkiStore reference implementation
Introduce a deterministic filesystem-backed PkiStore implementation
under zeroecho.pki.impl.fs.

Key characteristics:
- write-once semantics for immutable objects with explicit failure on
  overwrite
- history tracking for mutable records with full audit trail
- atomic writes using NIO (temp + move) with best-effort durability
- strict snapshot export supporting time-travel reconstruction
- configurable history retention (ON_WRITE policy)
- no secrets logged; JUL-only diagnostics for anomalies

Includes comprehensive JUnit 5 tests validating:
- write-once enforcement
- history creation and overwrite semantics
- strict snapshot export (failure and positive selection cases)
- deterministic on-disk layout and structure

This implementation is intentionally non-public and serves as a
reference and validation baseline for future persistence backends.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-28 01:15:46 +01:00
7673e7d82f feat: PKI module core design
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-27 21:38:32 +01:00
276ac91eb4 chore: replace apache-cli deprecated methods
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-27 16:55:28 +01:00
e82e0e57fb Merge hybrid cryptography support (KEX, derived keys, signatures)
This merge introduces the sdk.hybrid package with support for:
- hybrid key exchange (classic + post-quantum),
- hybrid-derived key injection for encryption and MAC builders,
- hybrid signature composition.

The implementation is additive at the SDK layer and does not modify
core cryptographic contracts.
2025-12-26 21:08:31 +01:00
300f40c283 feat: add hybrid-derived key injection
Extend HMAC metadata and builders to expose recommended key sizes and
enable safe derived-key injection without duplicating algorithm
configuration.

Key changes:
- Add HybridDerived utility for expanding hybrid KEX output and
  injecting purpose-separated keys, IVs/nonces and optional AAD into
  existing DataContent builders (AES-GCM, ChaCha, HMAC)
- Improve HmacSpec and HmacDataContentBuilder to expose recommended key
  material characteristics for derived use
- Refine HybridKexContexts to better support exporter-based derived
  workflows
- Add comprehensive unit tests for hybrid-derived functionality
- Add documented demo showing hybrid-derived AES-GCM encryption,
  including local (self-recipient) hybrid usage
- Introduce top-level sdk.hybrid package documentation and derived
  subpackage Javadoc

All changes are additive at the SDK layer; core cryptographic contracts
remain unchanged.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-26 21:00:01 +01:00
55da24735f feat: add hybrid key exchange framework
Introduce a complete SDK-level hybrid KEX framework combining classic
(DH/ECDH/XDH) and post-quantum (KEM adapter) agreement contexts.

Key additions:
- HybridKexContext and HybridKexContexts for hybrid handshake
  orchestration over existing AgreementContext and
  MessageAgreementContext APIs
- HybridKexProfile, HybridKexTranscript and HybridKexExporter providing
  HKDF-based key derivation, transcript binding and key schedule support
- HybridKexPolicy for optional security strength and output-length
  gating
- HybridKexBuilder offering a fluent, professional API for constructing
  CLASSIC_AGREEMENT + KEM_ADAPTER and PAIR_MESSAGE + KEM_ADAPTER
  variants
- Comprehensive JUnit tests and documented demo illustrating both hybrid
  modes

No changes to core cryptographic APIs; all hybrid logic is implemented
as additive functionality in the SDK layer.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-26 17:48:39 +01:00
34eca245f0 feat: add message-oriented agreement contexts for DH, ECDH and XDH
Introduce GenericJcaMessageAgreementContext and KeyPairKey to support
message-based key agreement without breaking existing AgreementContext
capabilities.

Key changes:
- Add KeyPairKey wrapper to carry KeyPair through capability dispatch.
- Introduce GenericJcaMessageAgreementContext implementing
  MessageAgreementContext, mapping the protocol message to an
  SPKI-encoded public key.
- Extend DH, ECDH and XDH algorithms with an additional
  MessageAgreementContext capability while preserving existing
  PrivateKey-based agreement usage.
- Improve core agreement tests to cover CLASSIC_AGREEMENT, PAIR_MESSAGE
  and KEM_ADAPTER variants with explicit branch identification.
- Add demo samples illustrating practical usage patterns for ML-KEM and
  XDH agreement variants, including lifecycle and resource management
  guidance.

This change adds capabilities by extension rather than replacement and
keeps existing APIs and behaviors fully backward compatible.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-26 14:56:47 +01:00
7f79082adc feat: introduce hybrid signature framework and signature trailer builder
Add a complete hybrid signature implementation combining two independent
signature algorithms with AND/OR verification semantics, designed for
streaming pipelines.

Key changes:
- Add zeroecho.sdk.hybrid.signature package with core hybrid signature
  abstractions (HybridSignatureContext, HybridSignatureProfile,
  factories, predicates, and package documentation).
- Introduce SignatureTrailerDataContentBuilder as a
  signature-specialized replacement for
  TagTrailerDataContentBuilder<Signature>, supporting
  core, single-algorithm, and hybrid signature construction.
- Extend sdk.builders package documentation to reference the new
  signature trailer builder and newly added PQC signature builders.
- Adjust TagEngineBuilder where required to support hybrid verification
  integration.
- Update JUL configuration to accommodate hybrid signature diagnostics
  without leaking sensitive material.

Tests and samples:
- Add comprehensive JUnit 5 tests covering hybrid signatures in all
  supported modes, including positive and negative cases.
- Add a dedicated sample demonstrating hybrid signing combined with AES
  encryption (StE and EtS).
- Update existing signing samples to reflect the new signature trailer
  builder.

The changes introduce a unified, extensible hybrid signature model
without breaking existing core APIs or pipeline composition patterns.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-26 02:01:29 +01:00
174d63dff4 feat: add ML-DSA and SLH-DSA streaming builders
chore: update alg package docs

Introduce DataContentBuilder implementations for ML-DSA and SLH-DSA
aligned with the existing SphincsPlus builder, and update the
builders.alg package Javadoc to document the newly supported
post-quantum signature schemes.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-25 19:24:39 +01:00
84b97b4e0a feat: add ML-DSA (FIPS 204) support with policy enforcement
Introduce ML-DSA (FIPS 204) as a first-class signature algorithm:
- algorithm binding and streaming signature context
- key generation specs/builders and key import specs
- correct handling of pure vs pre-hash (SHA-512) ML-DSA JCA variants
- policy security strength mapping (44/65/87 → 128/192/256)
- comprehensive JUnit streaming sign/verify tests

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-25 18:36:35 +01:00
2b4559884f fix: add SLH-DSA security strength estimation for policy enforcement
Extend SecurityStrengthAdvisor to recognize SLH-DSA keys and map their
parameter sets (128/192/256) to NIST security strengths.

This enables CryptoPolicy.minStrength(...) to enforce SLH-DSA profiles
consistently with other PQC algorithms.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-25 17:43:00 +01:00
8f228c7ada feat: SLH-DSA (FIPS 205) signature algorithm added
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-25 01:54:24 +01:00
4da4547a46 fix: defensively copy secret and encapsulation before destroy()
SecretWithEncapsulation may zeroize internal buffers on destroy().
Create defensive copies of the shared secret and ciphertext using
Arrays.copyOf() before destroying the result object to ensure stable
output.

No cryptographic behavior changes; fixes a potential lifecycle bug.

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-24 23:39:32 +01:00
cb363ba2f4 chore: deps upgrade
chore: PMD 8.0.0 obsolete rules replaced

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-24 22:33:00 +01:00
0b4b4de603 chore: PMD warnings clean-up
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-24 21:41:44 +01:00
eba163dd21 chore: deprecated applied
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-07 22:20:08 +01:00
31018235dc chore: javadoc fixes (format)
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-12-07 21:57:50 +01:00
e328a6a103 chore: softprops/action-gh-release wants newline-delimited globs of paths 2025-11-02 14:10:51 +01:00
0114f46907 chore: javadoc upload disabled (workflow)
All checks were successful
Release / release (push) Successful in 1m5s
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
release@1.0.1
2025-11-02 14:00:17 +01:00
56eb54bf9e fix: incorrect (package) javadoc for chacha and cmce
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-09-19 02:01:22 +02:00
0c4060774e fix: comments improved
All checks were successful
Release / release (push) Successful in 2m35s
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
release@1.0.0
2025-09-17 00:57:41 +02:00
f3ab7476f2 fix: incorrect comment about key size 2025-09-17 00:47:12 +02:00
2cc988925a Initial commit (history reset) 2025-09-16 23:14:24 +02:00