certreplace

Crates.iocertreplace
lib.rscertreplace
version
sourcesrc
created_at2022-11-28 14:52:50.727345
updated_at2024-12-06 01:09:40.311044
descriptionCLI tool for replacing x509 certificates and their private keys.
homepage
repositoryhttps://github.com/lirkwood/certreplace
max_upload_size
id724486
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
lkirkwood (lkirkwood)

documentation

README

certreplace

A tool for finding/replacing SSL certificates and their associated private keys.

Usage

Certreplace will always back up files with time-stamped names if they will be modified. Unless the -f, --force parameter is used, certreplace will always confirm before modifying any files.

Certreplace can find certificates in two ways. If given a name (-n, --name) or regex pattern (-e, --regex), it will find x509 certificates with a Subject Common Name or Subject Alternative Name matching that value.

If given a path to a certificate file (-c, --cert) it will attempt to find other certificates matching the input cert using the following steps:

  • If there is only one public cert in the file, the common name and alternative names will be used. Similar to running with the -n, --name parameter.
  • If you additionally provide a path to a private key file (-p, --priv) with only one private key in it, the public cert in the input file matching the provided private key will be used to search. This lets you use cert files with multiple public certs as input.

If you provided a public cert with -c, --cert, certreplace will attempt to replace any matching certs it finds with the input cert (after confirming each one). If you provided a private key with -p, --priv, certreplace will replace the private keys of matching certs aswell.

Examples

  1. certreplace /path/to/search --name <common name>

This will find all certificates with a Subject Common Name or Subject Alternative Names value exactly equal to the common name parameter. Additionally, it will find private keys that match one of the certificates.

  1. certreplace /path/to/search --regex <regex pattern>

This will find all certificates with a Subject Common Name or Subject Alternative Names value matching the regex pattern parameter. Additionally, it will find private keys that match one of the certificates.

  1. certreplace /path --name <common name> --cert <path>

Like example 1, but will replace matches with the input certificate.

  1. certreplace /path --name <common name> --cert <path> --priv <path>

Like example 3, but will try to replace the private keys of matches with the input privkey.

  1. certreplace /path --cert <path>

Like example 3, but will match based on the common/alternative names in the input certificate.

  1. certreplace /path --cert <path> --priv <path>

Like example 4, but will match based on the input certificate like example 5.

Commit count: 72

cargo fmt