From 6870dbbc3705590f2e4edf0783fd224dc9a9d8cc Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Tue, 9 Aug 2022 15:44:03 +0200 Subject: [PATCH] Update README : how to create or revoke many certificates at once --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index bdce064..472b84d 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,23 @@ Show help : shellpki help ~~~ +## Loop + +We can loop over a file to revoke or create many certificates at once. + +To revoke : + +~~~ +$ read CA_PASS +$ for cert_name in $(cat /path/to/file_certs_to_revoke); do CA_PASSWORD=$CA_PASS shellpki revoke $cert_name --non-interactive ; done +~~~ + +To create (without `--replace-existing`) or renew (with `--replace-existing`), with a password on the client key : + +~~~ +$ for cert_name in $(cat /path/to/file_certs_to_create); do apg -n 1 -m 16 -M lcN > /path/to/folder/to/store/${cert_name}.passwd; CA_PASSWORD=$CA_PASS shellpki create --replace-existing --non-interactive --password-file /path/to/folder/to/store/${cert_name}.passwd ${cert_name}; done +~~~ + ## License ShellPKI is an [Evolix](https://evolix.com) project and is licensed