Skip to content

Implementation for PKCS11 support#18043

Draft
ylangisc wants to merge 41 commits into
masterfrom
feature/GH-8401-pkcs11
Draft

Implementation for PKCS11 support#18043
ylangisc wants to merge 41 commits into
masterfrom
feature/GH-8401-pkcs11

Conversation

@ylangisc

@ylangisc ylangisc commented May 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@ylangisc ylangisc added this to the 9.5 milestone May 5, 2026
@ylangisc ylangisc added the core label May 5, 2026
@dkocher dkocher added sftp SFTP Protocol Implementation webdav WebDAV Protocol Implementation labels May 5, 2026
@ylangisc

This comment was marked as resolved.

@dkocher dkocher assigned ylangisc and unassigned dkocher May 14, 2026
@ylangisc

Copy link
Copy Markdown
Contributor Author
image

@dkocher dkocher marked this pull request as ready for review May 22, 2026 15:59
@dkocher dkocher requested a review from a team as a code owner May 22, 2026 15:59
Copilot AI review requested due to automatic review settings May 22, 2026 15:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a draft implementation toward issue #8401, aiming to enable authentication using private keys stored on SmartCards (PKCS#11), primarily by introducing a PKCS#11-backed X509KeyManager and wiring it into TLS session creation and the macOS UI/build packaging.

Changes:

  • Added PKCS11CertificateStoreX509KeyManager and DelegatingCertificateStoreX509KeyManager, and wired the delegator into SessionPoolFactory to expose both Keychain and PKCS#11 identities.
  • Refactored keystore handling by extracting DefaultCertificateStoreX509KeyManager from CertificateStoreX509KeyManager, updating usages/tests accordingly.
  • Updated macOS packaging/signing/runtime scripts to bundle and process .so (OpenSC PKCS#11), and added the smartcard sandbox entitlement.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
webdav/src/test/java/ch/cyberduck/core/dav/DAVSessionTest.java Updates test to use DefaultCertificateStoreX509KeyManager.
ssh/src/test/java/ch/cyberduck/core/sftp/openssh/OpenSSHAgentAuthenticatorTest.java Removes unused imports.
setup/app/sandbox.entitlements Adds smartcard entitlement for sandboxed macOS app.
runtime.xml Extends install-name handling to .so and sets -id per library.
osx/src/main/java/ch/cyberduck/ui/cocoa/controller/DefaultBookmarkController.java Removes unused imports.
osx/src/main/java/ch/cyberduck/ui/cocoa/controller/BookmarkController.java Populates certificate picker from Keychain + PKCS#11 aliases.
osx/pom.xml Copies .so runtime artifacts into app bundle frameworks.
osx/build.xml Rewrites OpenSC dylib install name references for bundled libs.
freenet/src/main/java/ch/cyberduck/core/freenet/FreenetAuthenticatedUrlProvider.java Switches to CertificateIdentityCallback.noop.
defaults/src/main/resources/default.properties Adds PKCS#11 library preference defaults/comments.
core/src/test/java/ch/cyberduck/core/ssl/CustomTrustSSLProtocolSocketFactoryTest.java Updates test to use DefaultCertificateStoreX509KeyManager.
core/src/test/java/ch/cyberduck/core/ssl/CertificateStoreX509KeyManagerTest.java Updates tests after keystore manager refactor.
core/src/main/java/ch/cyberduck/core/ssl/PreferencesX509KeyManager.java Uses CertificateIdentityCallback.noop.
core/src/main/java/ch/cyberduck/core/ssl/PKCS11CertificateStoreX509KeyManager.java New PKCS#11-backed keystore/key manager with PIN prompt.
core/src/main/java/ch/cyberduck/core/ssl/KeychainX509KeyManager.java Rebased on DefaultCertificateStoreX509KeyManager.
core/src/main/java/ch/cyberduck/core/ssl/DelegatingCertificateStoreX509KeyManager.java New delegator combining multiple key managers.
core/src/main/java/ch/cyberduck/core/ssl/DefaultCertificateStoreX509KeyManager.java New default keystore implementation extracted from base class.
core/src/main/java/ch/cyberduck/core/ssl/CertificateStoreX509KeyManager.java Refactored into abstract base with shared selection/key logic.
core/src/main/java/ch/cyberduck/core/SessionPoolFactory.java Uses delegating key manager (Keychain + PKCS#11).
core/src/main/java/ch/cyberduck/core/library/Native.java Makes getPath/getName public for broader use.
core/src/main/java/ch/cyberduck/core/diagnostics/HttpReachability.java Uses CertificateIdentityCallback.noop.
core/src/main/java/ch/cyberduck/core/CertificateIdentityCallbackFactory.java Returns CertificateIdentityCallback.noop on failure.
core/src/main/java/ch/cyberduck/core/CertificateIdentityCallback.java Adds noop constant instance.
core/dylib/src/test/java/ch/cyberduck/core/ssl/PKCS11CertificateStoreX509KeyManagerTest.java Adds basic PKCS#11 manager tests.
core/dylib/pom.xml Adds OpenSC runtime artifacts (opensc-pkcs11.so, libopensc.dylib).
core/dylib/build.xml Imports runtime.xml and adjusts target gating/formatting.
codesign.xml Adds .so to codesigning inputs.
cli/osx/pom.xml Copies .so runtime artifacts into CLI bundle frameworks.
cli/osx/build.xml Rewrites OpenSC dylib install name references for CLI bundle.
brick/src/main/java/ch/cyberduck/core/brick/BrickPairingFeature.java Uses CertificateIdentityCallback.noop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread osx/src/main/java/ch/cyberduck/ui/cocoa/controller/BookmarkController.java Outdated
Comment thread core/dylib/build.xml
@dkocher dkocher force-pushed the feature/GH-8401-pkcs11 branch from a064d75 to 49e4dc5 Compare May 28, 2026 13:00
@dkocher dkocher marked this pull request as draft May 28, 2026 13:28
@dkocher dkocher modified the milestones: 9.5, 9.6 Jun 9, 2026
@dkocher dkocher changed the title Draft implementation for PKCS11 support. Implementation for PKCS11 support Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core sftp SFTP Protocol Implementation webdav WebDAV Protocol Implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants