From 762ba66de8833180efc2e21fdb74745944c6bd95 Mon Sep 17 00:00:00 2001 From: Urko Date: Wed, 15 Feb 2023 19:41:00 +0100 Subject: [PATCH] feat: add README --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6c03f8c --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# go-gen-cert + +## Configuration +If you are on `dev` environment, like I've been doing, you must create `.env` file similar as `.env.example` in this repo: + +```bash +VIPER_CONFIG=your-viper-file-name-without-extension +VIPER_CONFIG_TYPE=yaml +ENV=dev +``` + +Then add viper configuration file, yaml for example, in your root directory: +```yaml +export_dir: "/home" +ca: + serial_number: 12152 # serial number + subject: + organization: "yourdomain.com" + common_name: "*.yourdomain.com" + key_usage: 1 + ext_key_usage: + - 1 + - 2 + duration: 518400 #1 year +client: + serial_number: 12151232 # serial number + subject: + organization: "yourdomain.com" + country: "RM" + province: "REML" + locality: "" + street_address: "" + postal_code: "" + subject_key_id: + - 1 + - 2 + - 3 + - 4 + - 6 + key_usage: 1 + ext_key_usage: + - 1 + - 2 + duration: 518400 +``` +## Execution +Then you can just run +```bash +go run main.go +``` \ No newline at end of file