{"id":39517172,"url":"https://github.com/lenchv/jks-js","last_synced_at":"2026-01-18T06:14:23.588Z","repository":{"id":51582074,"uuid":"244172090","full_name":"lenchv/jks-js","owner":"lenchv","description":"Extracts PEM certificates from Java Keystore in order to securely connect to Java based servers using node js","archived":false,"fork":false,"pushed_at":"2024-09-30T08:13:50.000Z","size":451,"stargazers_count":32,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-14T22:12:59.090Z","etag":null,"topics":["java","javascript","jks","js","keystore","nodejs","pem","ssl","tls","truststore"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lenchv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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-03-01T15:18:05.000Z","updated_at":"2024-10-30T02:50:30.000Z","dependencies_parsed_at":"2024-06-18T17:00:23.485Z","dependency_job_id":"3abf3ef5-8e8f-4a18-a491-df465756c7e6","html_url":"https://github.com/lenchv/jks-js","commit_stats":{"total_commits":56,"total_committers":6,"mean_commits":9.333333333333334,"dds":0.3571428571428571,"last_synced_commit":"4a4a9e57f5ad0f9db9d841d283a0b8c7e8f9be76"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/lenchv/jks-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenchv%2Fjks-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenchv%2Fjks-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenchv%2Fjks-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenchv%2Fjks-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lenchv","download_url":"https://codeload.github.com/lenchv/jks-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenchv%2Fjks-js/sbom","scorecard":{"id":584140,"data":{"date":"2025-08-11","repo":{"name":"github.com/lenchv/jks-js","commit":"1745675fb8a5ee19a2fe0825c324f888087bc7e8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 2/17 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/release.yml:12","Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/lenchv/jks-js/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/lenchv/jks-js/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/lenchv/jks-js/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/lenchv/jks-js/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/lenchv/jks-js/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/lenchv/jks-js/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/lenchv/jks-js/release.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:26","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:40","Warn: npmCommand not pinned by hash: .github/workflows/release.yml:21","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   3 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T19:58:20.620Z","repository_id":51582074,"created_at":"2025-08-20T19:58:20.620Z","updated_at":"2025-08-20T19:58:20.620Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["java","javascript","jks","js","keystore","nodejs","pem","ssl","tls","truststore"],"created_at":"2026-01-18T06:14:23.067Z","updated_at":"2026-01-18T06:14:23.581Z","avatar_url":"https://github.com/lenchv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JKS-JS\n\n[![npm](https://img.shields.io/npm/v/jks-js?color=blue\u0026style=flat-square)](https://www.npmjs.com/package/jks-js)\n[![test](https://github.com/lenchv/jks-js/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/lenchv/jks-js/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/lenchv/jks-js/branch/master/graph/badge.svg)](https://codecov.io/gh/lenchv/jks-js)\n\n## Description\n\n**jks-js** is a converter of [Java Keystore](https://en.wikipedia.org/wiki/Java_KeyStore) to PEM certificates in order to securely connect to Java based servers using node js.\n\n## Installation\n\n```javascript\nnpm install jks-js\n```\n\n## Usage\n\n```javascript\n...\nconst jks = require('jks-js');\n\nconst keystore = jks.toPem(\n\tfs.readFileSync('keystore.jks'),\n\t'password'\n);\n\nconst { cert, key } = keystore['alias'];\n\n```\n\nafter extraction you may use cert and key in your connection settings:\n\n```javascript\ntls.connect('\u003cport\u003e', '\u003chost\u003e', {\n\tkey: key,\n\tcert: cert,\n});\n```\n\n[more details](https://nodejs.org/api/tls.html#tls_tls_connect_options_callback)\n\n## API\n\n```javascript\nconst {\n\t/**\n\t * Extracts certificates from java keystore or truststore\n\t * and decrypts private key \n\t * \n\t * @param keystore content of java keystore or truststore file\n\t * @param keystorePassword password for verification and decryption\n\t * @param pemPassword (optional) password that is used for decryption, in case it is different from keystorePassword. If not specified, keystorePassword is used\n\t * @return {\n\t *     \u003calias name\u003e: {\n\t *         cert: string // compound certificates chain\n\t *         key: string // decrypted private key \n\t *     } | {\n\t *         ca: string // trusted certificate\n\t *     }\n\t * }\n\t */\n\ttoPem,\n\n\t/**\n\t * The raw function to extract certificates\n\t * @param keystore\n\t * @param password\n\t * @return { \u003calias name\u003e: KeyEntry | TrustedKeyEntry }\n\t */\n\tparseJks,\n\n\t/**\n\t * Decrypts private key from DER to PEM\n\t *\n\t * @param protectedPrivateKey DER encoded private key\n\t * @param password password for PKCS8 decryption\n\t * @return decoded private key \n\t */\n\tdecrypt,\n\n\t/**\n\t * The function that parses keystore/truststore in PKCS12 format\n\t * \n\t * @param {Buffer} keystore\n\t * @param {String} password\n\t */\n\tparsePkcs12,\n} = require('jks-js');\n```\n\n## How it works\n\nThe implementaion is based on [JavaKeystore.java](https://github.com/frohoff/jdk8u-jdk/blob/da0da73ab82ed714dc5be94acd2f0d00fbdfe2e9/src/share/classes/sun/security/provider/JavaKeyStore.java#L605) logic, which is internally used for creation of java keystore, including `keytool`.\n\nIt is supposed the keystore contains `X.509` certificates.\n\nBut you may use the library to extract any of certificates.\n\nThe decryption constrained by alghorithms that implemented in the [crypto](https://nodejs.org/api/crypto.html#crypto_keyobject_asymmetrickeytype) module of Node.js.\n\n## Issues\n\nIf you find any troubles feel free to create an issue.\n\n## License\n\n[MIT License](LICENSE)\n\nCopyright (c) 2020 Volodymyr Liench\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flenchv%2Fjks-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flenchv%2Fjks-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flenchv%2Fjks-js/lists"}