{"id":20875200,"url":"https://github.com/smallrye/smallrye-certificate-generator","last_synced_at":"2025-05-12T15:31:09.877Z","repository":{"id":261059808,"uuid":"823552920","full_name":"smallrye/smallrye-certificate-generator","owner":"smallrye","description":"Utilities to generated signed and self-signed certificates","archived":false,"fork":false,"pushed_at":"2025-03-17T03:53:06.000Z","size":217,"stargazers_count":2,"open_issues_count":6,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-01T07:23:17.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smallrye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-07-03T08:48:53.000Z","updated_at":"2024-12-13T10:05:32.000Z","dependencies_parsed_at":"2024-11-04T14:18:05.134Z","dependency_job_id":"f0954a28-5fe2-4605-b283-022e29c4e55a","html_url":"https://github.com/smallrye/smallrye-certificate-generator","commit_stats":null,"previous_names":["smallrye/smallrye-certificate-generator"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallrye%2Fsmallrye-certificate-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallrye%2Fsmallrye-certificate-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallrye%2Fsmallrye-certificate-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallrye%2Fsmallrye-certificate-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smallrye","download_url":"https://codeload.github.com/smallrye/smallrye-certificate-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253765824,"owners_count":21960797,"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":[],"created_at":"2024-11-18T06:43:01.885Z","updated_at":"2025-05-12T15:31:09.168Z","avatar_url":"https://github.com/smallrye.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 Certificate Generator\n\nA Java API, a Junit 5 extension and a Maven plugin to generate (self-signed) certificates as well a signed certificate.\nThe main goal is to provide an easy way to generate self-signed and signed certificates.\n\n## Features\n\n- JKS, PEM and PKCS12 format support\n- mTLS (client and server) generation support\n- Maven plugin to generate certificates\n- Junit 5 extension to generate certificates in tests\n- Local CA generation\n- Generate signed certificates\n\n## Generated files\n\nHere is the list of generated files:\n\n**Format: JKS and server only (no mTLS)**\n\n- 🔐  Key Store File: $DIR/$NAME-keystore.jks\n- 🔓  Trust Store File: %DIR/$NAME-truststore.jks (to be deployed on the client-side)\n\n**Format: PEM and server only (no mTLS)**\n\n- 🔑  Key File: $DIR/$NAME.key\n- 📜  Cert File: $DIR/$NAME.crt\n- 🔓  Trust Store File: $DIR/$NAME-ca.crt (to be deployed on the client-side)\n\n**Format: PKCS12 and server only (no mTLS)**\n\n- 🔐  Key Store File: $DIR/$NAME-keystore.p12\n- 🔓  Trust Store File: %DIR/$NAME-truststore.p12 (to be deployed on the client-side)\n\n**Format: JKS and mTLS**\n\n- 🔐  Key Store File: DIR/$NAME-keystore.jks (to be deployed on the server-side)\n- 🔓  Server Trust Store File: $DIR/$NAME-server-truststore.jks (to be deployed on the server-side, contains the client certificate)\n- 🔐  Client Key Store File: $DIR/$NAME-client-keystore.jks (to be deployed on the client-side)\n- 🔓  Client Trust Store File: $DIR/$NAME-client-truststore.jks (to be deployed on the client-side, contains the server certificate)\n\n**Format: PEM and mTLS**\n\n- 🔑  Key File: $DIR/$NAME.key (to be deployed on the server-side)\n- 📜  Cert File: $DIR/$NAME.crt (to be deployed on the server-side)\n- 🔓  Server Trust Store File: $DIR/$NAME-server-ca.crt (to be deployed on the server-side, contains the client certificate)\n- 🔑  Client Key File: $DIR/$NAME-client.key (to be deployed on the client-side)\n- 📜  Client Cert File: $DIR/$NAME-client.crt (to be deployed on the client-side)\n- 🔓  Client Trust Store File: $DIR/$NAME-client-ca.crt (to be deployed on the client-side, contains the server certificate)\n\n\n**Format: PKCS12 and mTLS**\n\n- 🔐  Key Store File: DIR/$NAME-keystore.p12 (to be deployed on the server-side)\n- 🔓  Server Trust Store File: $DIR/$NAME-server-truststore.p12 (to be deployed on the server-side, contains the client certificate)\n- 🔐  Client Key Store File: $DIR/$NAME-client-keystore.p12 (to be deployed on the client-side)\n- 🔓  Client Trust Store File: $DIR/$NAME-client-truststore.p12 (to be deployed on the client-side, contains the server certificate)\n\n## Junit 5 extension\n\nThe project provides a JUnit 5 extension to generate certificates for each test.\nThe certificates are generated before any test of the test case run (like a `@BeforeAll`).\n\nTo use the Junit 5 extension, add the following dependency to your project:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.smallrye.certs\u003c/groupId\u003e\n    \u003cartifactId\u003esmallrye-certificate-generator-junit5\u003c/artifactId\u003e\n    \u003cversion\u003e${VERSION}\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nThen, you can use the `@Certificates` annotation to generate certificates for your test:\n\n```java\n@Certificates(\n    baseDir = \"target/certificates\",\n    certificates = {\n        @Certificate(name = \"reload-C\", password = \"secret\", formats = Format.PEM),\n        @Certificate(name = \"reload-D\", password = \"secret\", formats = Format.PEM),\n    }\n)\n```\n\n## Maven Plugin Usage\n\nHere is an example of the Maven plugin usage:\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eio.smallrye.certs\u003c/groupId\u003e\n    \u003cartifactId\u003esmallrye-certificate-generator-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e${VERSION}\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cphase\u003egenerate-test-resources\u003c/phase\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003egenerate\u003c/goal\u003e\n            \u003c/goals\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n    \u003cconfiguration\u003e\n        \u003ccertificates\u003e\n            \u003ccertificate\u003e\n                \u003cname\u003ereload-A\u003c/name\u003e \u003c!-- the name of the certificate --\u003e\n                \u003cformats\u003e  \u003c!-- List of formats to generate, are supported PEM, JKS and PKCS12 --\u003e\n                    \u003cformat\u003ePEM\u003c/format\u003e\n                    \u003cformat\u003ePKCS12\u003c/format\u003e\n                \u003c/formats\u003e\n                \u003cpassword\u003esecret\u003c/password\u003e \u003c!-- Password for the key store if supported --\u003e\n                \u003ccn\u003elocalhost\u003c/cn\u003e \u003c!-- Common Name --\u003e\n                \u003cduration\u003e2\u003c/duration\u003e \u003c!-- in days --\u003e\n                \u003cclient\u003etrue\u003c/client\u003e \u003c!-- Generate a client certificate --\u003e\n            \u003c/certificate\u003e\n            \u003ccertificate\u003e\n                \u003cname\u003ereload-B\u003c/name\u003e\n                \u003cformats\u003e\n                    \u003cformat\u003ePEM\u003c/format\u003e\n                    \u003cformat\u003ePKCS12\u003c/format\u003e\n                \u003c/formats\u003e\n                \u003cduration\u003e365\u003c/duration\u003e\n                \u003cpassword\u003esecret\u003c/password\u003e\n            \u003c/certificate\u003e\n        \u003c/certificates\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\n## API Usage\n\nFirst, you need to add the following dependency to your project:\n\n```xml\n\u003cdependency\u003e    \n  \u003cgroupId\u003eio.smallrye.certs\u003c/groupId\u003e\n  \u003cartifactId\u003esmallrye-certificate-generator\u003c/artifactId\u003e\n   \u003cversion\u003e${VERSION}\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e  \n\u003c/dependency\u003e\n```\n\nThen, uou can use the `io.smallrye.certs.CertificateGenerator` API to generate certificates programmatically:\n\n```java\nCertificateRequest request = new CertificateRequest()\n                .withName(\"test\")\n                .withPassword(\"secret\")\n                .withClientCertificate()\n                .withFormat(Format.JKS)\n                .withFormat(Format.PEM);\n        new CertificateGenerator(tempDir).generate(request);\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallrye%2Fsmallrye-certificate-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmallrye%2Fsmallrye-certificate-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallrye%2Fsmallrye-certificate-generator/lists"}