{"id":26234024,"url":"https://github.com/teragrep/jai_02","last_synced_at":"2026-04-30T05:36:28.672Z","repository":{"id":227669133,"uuid":"772039091","full_name":"teragrep/jai_02","owner":"teragrep","description":"Teragrep Authentication Info in JSON for Java","archived":false,"fork":false,"pushed_at":"2024-06-06T09:00:54.000Z","size":74,"stargazers_count":0,"open_issues_count":7,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-30T12:40:24.795Z","etag":null,"topics":["authentication","authn","java","java-library","json","library","teragrep"],"latest_commit_sha":null,"homepage":"https://teragrep.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teragrep.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-14T12:23:27.000Z","updated_at":"2025-01-28T11:47:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"81a6dc4d-bdad-446f-a8ea-09caf3bb783d","html_url":"https://github.com/teragrep/jai_02","commit_stats":null,"previous_names":["teragrep/jai_02"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/teragrep/jai_02","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjai_02","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjai_02/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjai_02/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjai_02/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teragrep","download_url":"https://codeload.github.com/teragrep/jai_02/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjai_02/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32456167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"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":["authentication","authn","java","java-library","json","library","teragrep"],"created_at":"2025-03-13T01:18:32.013Z","updated_at":"2026-04-30T05:36:23.660Z","avatar_url":"https://github.com/teragrep.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= jai_02\n\nJava Authentication Info. Provides a secure way of storing authentication information with\nencryption and salting.\n\n== Features\n\n* Provides load, save, verify and delete capabilities for Java KeyStore entries.\n* Uses PKCS12 KeyStore format by default and PBKDF2WithHmacSHA1 algorithm for SecretKeys.\n* The underlying KeyStore file can be modified without disrupting the functionality.\n* Utilizes a cache for username-password pairs verification.\n* Contains a KeyStoreFactory that is optional to use, but makes loading one easier.\n\n== Documentation\n\nSee the official documentation on https://docs.teragrep.com[docs.teragrep.com].\n\n== Limitations\n\n* Not all Java KeyStore formats and SecretKey algorithms are supported. This however is a conscious\ndesign choice as the others were deemed insecure for the purposes of this project.\n\n== How to build and use\n\nBuilding with Maven:\n[source, bash]\n----\n$ mvn clean [install|package]\n----\n\nExample usage:\n[source,java]\n----\nimport com.teragrep.jai_02.keystore.*;\nimport javax.crypto.SecretKey;\n\npublic class JAI02Example {\n    public static void main(String[] args) {\n        // Initialize a Caching and Reloading KeyStoreAccess object.\n        // Note: KeyStoreAccess can be used on its own, and you can choose\n        // whether to use Reloading and Caching KeyStore accesses.\n        CachingKeyStoreAccess cksa = new CachingKeyStoreAccess(\n        new ReloadingKeyStoreAccess(\n                new KeyStoreAccessImpl(\n                        new KeyStoreFactory(path, pw.toCharArray()).build(),\n                        path, pw.toCharArray()), 10L),\n                10L);\n\n        // Loading a key - this will throw an exception if not present\n        PasswordEntry loadedEntry = cksa.loadKey(username);\n        EntryAlias loadedAlias = loadedEntry.entryAlias();\n        SecretKey loadedSecret = loadedEntry.secretKey();\n\n        // Saving a key - this will throw an exception if it was already present\n        cksa.saveKey(username, pw.toCharArray());\n\n        // Deleting an entry\n        int deleted = cksa.deleteKey(username);\n        System.out.printf(\"Deleted \u003c%s\u003e entries for username \u003c[%s]\u003e\\n\", deleted, username);\n\n        // Check if the username-password combination was correct\n        boolean authOk = cksa.verifyKey(username, pw.toCharArray());\n        if (authOk) {\n            System.out.printf(\"User \u003c[%s]\u003e was authenticated!\\n\", username);\n        } else {\n            System.out.printf(\"User \u003c[%s]\u003e was NOT authenticated!\\n\", username);\n        }\n    }\n}\n----\n\n\n== Contributing\n\nYou can involve yourself with our project by https://github.com/teragrep/repo-template/issues/new/choose[opening an issue] or submitting a pull request.\n\nContribution requirements:\n\n. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so.\n. Security checks must pass\n. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.\n. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).\n\nRead more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].\n\n=== Contributor License Agreement\n\nContributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.\n\nYou need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Fjai_02","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteragrep%2Fjai_02","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Fjai_02/lists"}