redwax-tool(1)

πŸ“¦ version 1.0.0, in epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

redwax-tool πŸ’…

okay bestie, welcome to redwax-tool(1) β€” the manual page for redwax-tool, and honestly? it's giving main character energy. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

redwax-tool β€” the Redwax tool. that's it, that's the name, periodt. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

redwax-tool [-v] [-h] [in options ...] [filter options ...] [out options ...]

🌸 DESCRIPTION 🌸

so the tea is: redwax-tool lets you read certificates and keys in a whole range of formats and convert them into other formats, whatever the common services need. it's the versatile icon of the group chat. πŸ”₯

here's the thing you actually gotta internalize: options are read in order, in three phases. first all the input options get read, then all the filter options, then all the output options. in order. no skipping, no reordering, no chaos. it's structured, and we respect that. πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

general vibes ✨

  • -h, --help β€” display this help message. the "help me bestie" button. 🫢
  • -v, --version β€” display the version number. show me the numbers. ⭐
  • -q, --quiet β€” be quiet. errors are suppressed. shy girlie mode. πŸ™ˆ
  • -d, --debug β€” be loud. prints extra details of our progress. main character announcement mode. πŸ“£

DNS stuff 🧚

  • --dns-server=ip β€” if you specify it, it supplies the IP address of the upstream DNS server. you can specify it more than once, she's flexible. if you don't specify it, it reads from /etc/resolv.conf instead.
  • --dns-trust-anchor=file β€” specify the file containing the DNSSEC trust anchor. if you don't specify it, the key may be read from an OS-specific default location. it'll find its own way home. 🏠

secrets 🀫

  • --secret-suffix-in=suffix β€” if specified, secrets get read from a file with the same name as the source file plus the suffix you gave. so with the value secret, a file key.pem has its secret loaded from key.secret in the same directory. cute matching set, honestly. πŸŽ€
  • --secret-suffix-out=suffix β€” same deal but for the target file: if specified, secrets get read from a file with the same name as the target file plus the suffix. with the value secret, a file key.pem has the secret loaded from key.secret in the same directory. πŸ’–
  • --secret-token-in=file β€” if specified, secrets needed to read certificates and keys from tokens get read from a file, one secret per line. each secret is preceded by the name of the token and a colon, as per the NSS pwdfile.txt file.
  • --secret-token-out=file β€” if specified, secrets needed to write certificates and keys to tokens (PKCS11 and NSS) get read from a file, one secret per line. each secret is preceded by the name of the token and a colon, as per the NSS pwdfile.txt file.

labels 🏷️

  • --label-out=label β€” sets the name of the label applied to the leaf certificates. if you don't specify it, the label is set to the subject of the certificate. it picks for you, slay.

input options πŸ“₯

  • --pem-in=wildcard β€” read pem files from here. use - for stdin.
  • --trust-pem-in=wildcard β€” read pem files containing trusted certificates from here. use - for stdin.
  • --pkcs12-in=file β€” read certificates, intermediate certificates, root certificates, crls, and keys from a PKCS12 file. use - for stdin. provide the secret using --secret-suffix-in.
  • --pkcs11-in=url β€” read certificates, intermediate certificates, root certificates, crls, and keys from a PKCS11 token identified by the given url.
  • --pkcs11-module-in=mod β€” specify the name of the PKCS11 module to be used, overriding system defaults. if it's relative, use the default PKCS11 module path; otherwise specify the absolute path. include the extension of the module. don't forget the extension, bestie, it matters. ⚠️
  • --keychain-in=keychain β€” read certificates, intermediate certificates, root certificates, crls, and keys from a MacOS keychain identified by the given name.
  • --tls-in=url β€” read certificates and intermediate certificates from a TLS or DTLS endpoint at the given url.

filter options πŸ”

  • --filter=type β€” apply the given filter to pass inputs through to the outputs. "search" passes through all certificates matching the given hostname, email or ip address. "verify" passes all leaf certificates that can be successfully verified through the certificate chain to a trusted root certificate. and with the default, "passthrough", all certificates, csrs, and keys are passed through. no gatekeeping. ✨
  • --filter-email=address β€” search/verify by the given email address. leaf certificates matching the email address get included. can be specified more than once.
  • --filter-hostname=domain β€” search/verify by the given hostname. leaf certificates matching the hostname get kept, taking into account wildcards where present. wildcards are valid, ok?! πŸ¦„
  • --filter-ip=address β€” search/verify by the given IP address. leaf certificates matching the IP address get included. can be specified more than once.
  • --filter-current β€” match the top ranking leaf certificate and ignore all other leaf certificates. the top certificate is valid and has the longest time to expiry. only the winner survives, it's giving competitive. πŸ‘‘
  • --filter-verify-params=name β€” specify the name of the set of parameters used for verification. if unspecified, set to 'default'.
  • --filter-verify-tlsa=url β€” perform DANE verification on the server certificate. the parameter is an URL, with a hostname, an optional scheme defaulting to tcp, and an optional port defaulting to 443 (example: tcp://example.com:443). if unspecified, no DANE verification is performed.
  • --filter-date=date β€” set the date to be used for certificate verification. if unset, it defaults to the current time. date format is generalized time syntax as defined in RFC 4517 section 3.3.13. very specific, very demure. πŸ“…
  • --filter-expiry=[option] β€” verify certificate expiry. 'check' does expiry verification. 'ignore' allows expired certificates. 'ignore-leaf' allows expired leaf certificates. 'ignore-chain' allows expired chain certificates. default is 'check'.
  • --filter-dane=[option] β€” verify certificate DANE records. 'check' does dane verification. 'ignore' allows certificates with mismatched DANE TLSA or SMIMEA records. default is 'check'.
  • --filter-purpose=purpose β€” set the purpose of the certificate to verify. if unset, it defaults to any purpose. she's open-minded like that. 🌈

output toggles 🎚️

  • --text-out β€” include additional text in certificate PEM and metadata output.
  • --no-text-out β€” exclude additional text in certificate PEM and metadata output.
  • --cert-out β€” include leaf certificates in certificate output.
  • --no-cert-out β€” exclude leaf certificates from certificate output.
  • --chain-out β€” search for and include intermediate certificates belonging to leaf certificates in certificate output. when verifying, if a chain can't be created through intermediate certificates to a trusted root certificate, the leaf certificate is ignored. no chain, no service. πŸ’€
  • --no-chain-out β€” exclude intermediate certificates belonging to leaf certificates in certificate output.
  • --root-out β€” search for and include root certificates at the end of the certificate chain. when verifying, if a chain can't be created through intermediate certificates to a root certificate, the leaf certificate is ignored.
  • --no-root-out β€” exclude root certificates at the end of the certificate chain in output.
  • --trust-out β€” identical to the 'root' option, however where supported the output certificates will be exported as a "TRUSTED CERTIFICATE" as recognised by OpenSSL.
  • --no-trust-out β€” exclude root certificates that would otherwise be output as OpenSSL "TRUSTED CERTIFICATE".
  • --crl-out β€” include certificate revocation lists in the output.
  • --no-crl-out β€” exclude certificate revocation lists from the output.
  • --parameter-out β€” include key parameters in the output.
  • --no-parameter-out β€” exclude key parameters from the output.
  • --key-in β€” read private keys in the input. this will trigger a login attempt if needed. πŸ”
  • --no-key-in β€” exclude keys from the input.
  • --key-out β€” include keys in the output.
  • --no-key-out β€” exclude keys from the output.
  • --auto-out β€” output selectively. if a key or a certificate already exists in a PKCS11 token, skip writing the key or certificate. a key is considered to already exist if the Subject Key Info of the incoming key matches the Subject Key Info field of an existing key on the token. a certificate is considered to already exist if another certificate with the same value is present on the token. when adding a certificate, look up the ID of any corresponding key and use that ID for the certificate (unless an ID is explicitly specified in a target URL). she's efficient, she's not doing duplicates. πŸ’…
  • --no-auto-out β€” output everything as specified.

output destinations πŸ“€

  • --nss-out=directory β€” write certificates, intermediate certificates, root certificates, crls, and keys to an NSS database.
  • --nss-token-out=token β€” specify the token to which certificates, intermediate certificates, root certificates, crls, and keys will be written to an NSS database. must appear after the --nss-out option. order matters, bestie, don't test her. ⚠️
  • --der-out=prefix β€” write certificates, intermediate certificates, root certificates, crls, and keys. each one is written to a file with a suffix indicating type and index. use - for stdout, and output will be concatenated.
  • --pem-out=file β€” write certificates, intermediate certificates, root certificates, crls, and keys. use - for stdout.
  • --pkcs12-out=file β€” write certificates, intermediate certificates, root certificates, crls, and keys into a PKCS12 file. use - for stdout.
  • --pkcs11-out=url β€” write certificates, intermediate certificates, root certificates, crls, and keys into a PKCS11 token identified by the given url.
  • --pkcs11-module-out=mod β€” specify the name of the PKCS11 module to be used, overriding system defaults. if it's relative, use the default PKCS11 module path; otherwise specify the absolute path. include the extension of the module. again: extension. include it. 🫢
  • --metadata-out=file β€” write metadata of each certificate and key to the given file in the format given by the format parameter.
  • --metadata-threshold=days β€” set the threshold in days below which an expiry becomes a warning. if unset, defaults to no warning.
  • --format-out=xml|json|yaml β€” format of output metadata. pick your aesthetic. ✨
  • --calendar-out=file β€” write a calendar containing entries until the expiry date of each certificate to the given file or directory. if a directory is specified, entries will be created in discrete ICS files. πŸ—“οΈ

okay that's part 1 bestie, there's more coming β€” don't go anywhere πŸ¦‹

  • --reminder-out=file β€” drops a whole calendar of reminders into the given file or directory, one reminder per certificate, all keyed to that cert's expiry date. Point it at a directory instead and it'll scatter the entries into separate little .ICS files, one vibe per file. πŸ—“οΈ
  • --calendar-alarm=duration β€” say the word and every calendar entry gets an alarm slapped on it (only if it doesn't already have one, no double-dipping). The alarm wants an RFC5545 DURATION, exactly as described in section 3.3.6. Example: -P1W = one whole week before expiry. ⏰
  • --user-in=user β€” read certificates and keys while wearing this user's privileges. ✨
  • --user-out=user β€” write certificates and keys while wearing this user's privileges. πŸ’…
  • --group-in=group β€” read certificates and keys with this group's privileges. Heads up bestie: if you already set a user before setting a group, you might not have permission to set the group anymore. So if you're doing both, set the group first. Order matters, fr fr. ⚠️
  • --group-out=group β€” write certificates and keys with this group's privileges. Same deal: set a user before a group and you may lose the permission to set that group. Recommended: if user and group are both in play, group goes first. πŸ™ˆ
  • --order-out=[all|key-first|key-last] β€” controls the order that keys and certs show up in the output. The tea:
    • all β€” every leaf certificate, then all intermediates, then all roots, then all the keys. Grouped by type, very tidy, very organised.
    • key-first β€” outputs all certificates that have a matching private key, with the private key first, then the certificate, then intermediates and roots, then the private key of the next certificate, and so on down the line.
    • key-last β€” same matching-private-key certificates, but the certificate comes first, then intermediates and roots, then that certificate's key, and finally the next certificate-with-a-private-key, and so on. Basically the mirror of key-first. πŸͺž
  • --ssh-public-out=file β€” writes an SSH public key out to the given file. πŸ”‘

🌈 RETURN VALUE 🌈

okay so when the redwax tool finishes, it tells you exactly how it went with one of these numbers:

  • 0 β€” we completed our task successfully. ate and left no crumbs. πŸ‘‘
  • 1 β€” we failed to initialise. rough start. 😭
  • 2 β€” the command line options were not valid. bestie the flags... 😬
  • 3 β€” no certificates were passed through the filter. empty handed. πŸ’€
  • 4 β€” could not become user or group. the privilege glow-up did not happen. πŸ™ˆ
  • 5 β€” capability not implemented on this platform. not a thing here, sorry. 🫢
  • 6 β€” processing of certificates failed. it's giving error energy. πŸ”₯

✨ EXAMPLES ✨

okay so in this one: we read every PEM file matching the wildcard, we pass all the certificates through the filter, and then we write chain certificates only to the file intermediates.pem in PEM format. slay.

~$ redwax-tool --pem-in *.pem --filter passthrough --chain-out
        --pem-out intermediates.pem

πŸ’– AUTHOR πŸ’–

Graham Leggett <minfrin@sharp.fm> β€” the icon, the legend, the main character who wrote this whole thing. 🫢


and that's the page bestie!! this was redwax-tool-1.0.0, dated 23 June 2025, and the manual page is redwax-tool(1) πŸ’…βœ¨ go forth and wrangle those certificates, no cap πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from