{"id":24512014,"url":"https://github.com/ddosolitary/sunpkcs11wrapper","last_synced_at":"2026-05-19T11:06:10.677Z","repository":{"id":101398429,"uuid":"285740652","full_name":"DDoSolitary/SunPKCS11Wrapper","owner":"DDoSolitary","description":"A wrapper of SunPKCS11 which is compatible with Java 8","archived":false,"fork":false,"pushed_at":"2021-01-17T13:49:22.000Z","size":68,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T00:44:01.387Z","etag":null,"topics":["android","android-sdk","java","pkcs11","security","yubikey"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DDoSolitary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-07T04:55:32.000Z","updated_at":"2023-08-08T23:35:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"de16e157-97a7-4ea1-82fc-feefce0a61e4","html_url":"https://github.com/DDoSolitary/SunPKCS11Wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DDoSolitary%2FSunPKCS11Wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DDoSolitary%2FSunPKCS11Wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DDoSolitary%2FSunPKCS11Wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DDoSolitary%2FSunPKCS11Wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DDoSolitary","download_url":"https://codeload.github.com/DDoSolitary/SunPKCS11Wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713416,"owners_count":20335567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-sdk","java","pkcs11","security","yubikey"],"created_at":"2025-01-22T00:44:05.060Z","updated_at":"2026-05-19T11:06:05.657Z","avatar_url":"https://github.com/DDoSolitary.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SunPKCS11Wrapper\n\nStarting from OpenJDK 9, the `sun.security.pkcs11.SunPKCS11` class no longer provides the constructor accepting a configuration file, and instead, a new `configure()` method is added to the `java.security.Provider` class to support the same functionality. However, the `apksigner` tool from Android SDK doesn't support this new interface and will crash when trying to instantiate the `SunPKCS11` class.\n\nThis project provides a wrapper class with the old constructor interface, making `apksigner` compatible with OpenJDK 9 and later releases.\n\n## Usage\n\n1. [Download `SunPKCS11Wrapper.jar`](https://ddosolitary-builds.sourceforge.io/SunPKCS11Wrapper.jar) and copy it to `\u003csdk-path\u003e/build-tools/\u003cversion\u003e/lib/`.\n\n2. **Linux**:  \n   In the last line of the file `\u003csdk-path\u003e/build-tools/\u003cversion\u003e/apksigner` (which should be an `exec` command), replace `-jar \"$jarpath\"` with `-cp \"$jarpath:$libdir/SunPKCS11Wrapper.jar\" com.android.apksigner.ApkSignerTool`.\n\n   **Windows**:  \n   In the last line of the file `\u003csdk-path\u003e/build-tools/\u003cversion\u003e/apksigner.bat` (which should be a `call` command), replace `-jar \"%jarpath%\"` with `-cp \"%jarpath%;%frameworkdir%\\SunPKCS11Wrapper.jar\" com.android.apksigner.ApkSignerTool`.\n\n3. Run apksigner as usual, but pass `org.ddosolitary.pkcs11.SunPKCS11Wrapper` instead of `sun.security.pkcs11.SunPKCS11` to the `--provider-class` option.  \n   For example:  \n   ```bash\n   apksigner sign \\\n       --ks NONE \\\n       --ks-key-alias \u003cYOUR_KEY_ALIAS\u003e \\\n       --ks-type PKCS11\n       --provider-class org.ddosolitary.pkcs11.SunPKCS11Wrapper \\\n       --provider-arg \u003cPATH_TO_CONFIG_FILE\u003e \\\n       \u003cPATH_TO_APK_FILE\u003e\n   ```\n\n## See also\n\nhttp://mail.openjdk.java.net/pipermail/jep-changes/2015-November/000219.html\n\nhttps://issuetracker.google.com/issues/132333137\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddosolitary%2Fsunpkcs11wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddosolitary%2Fsunpkcs11wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddosolitary%2Fsunpkcs11wrapper/lists"}