cfssl icon indicating copy to clipboard operation
cfssl copied to clipboard

feat(cfssljson): Add `-output` argument to save files in another directory

Open eddyzags opened this issue 2 years ago • 0 comments

Problem

Currently, cfssljson doesn't provide any way to write the separate key, certificate, csr, and bundle files in a specific folder. This is inconvenient if we want to output the certificates in a different directory.

A workaround would be to use the -stdout argument, which writes every file in the standard output separated by a blank line. Then, redirect the output to a specific folder. Example:

cfssl gencert -initca ca_csr.json | cfssljson -bare -stdout ca > path/to/folder/certs

But, this approach writes every entity in one file, then requires us to re-process the output of cfssjson to separate the key, certificate, csr, and bundle.

This PR adds an --output argument to the cfssljson tool to place output files into a specific directory.

eddyzags avatar Mar 26 '23 11:03 eddyzags