aethercert
Documentation

actk command-line reference

Every actk command and flag: create a CSR from the command line, build a PFX, sign code, manage the Windows certificate store, scan networks and grade TLS endpoints.

actk is the toolkit on the command line: the same tools as the desktop app, for scripts, scheduled scans and servers without a desktop. Download actk-windows-amd64.exe from the overview and save it as actk.exe in a folder on your PATH.

actk <command> [options]
actk <command> --help
actk --version
CommandWhat it does
csrCreate a private key and a certificate signing request (or a self-signed certificate).
decodeShow what a CSR contains and whether a CA will accept it.
pfxBundle an issued certificate and its chain with the key into a .pfx.
exportWrite a certificate file or a PFX as .cer, .crt/.pem, full chain, chain only or .key.
signAuthenticode-sign exe, dll, msi, PowerShell scripts and more.
verifyShow the Authenticode signature of files.
certsList the code signing certificates in the Windows store, including USB tokens and HSMs.
storeThe personal certificates in the Windows store: list, import, export, delete.
scanScan address ranges and ports for TLS certificates.
securityGrade one TLS endpoint like the aethercert.com Security Scan.

Passwords are prompted for. For unattended use, every password has a --...-env VAR flag that reads it from an environment variable instead. No password is ever accepted as a command-line argument, where it would end up in the shell history and the process list.

Exit codes: 0 success; 1 the command ran but the result is negative (a CSR a CA would reject, a signature that failed, a security scan that could not complete, a declined deletion); 2 an error, such as a missing file or a bad argument.

Output is coloured when it goes to a terminal; set NO_COLOR to turn colour off.

actk csr

actk csr --cn <name> [options]

Writes <name>.csr and <name>.key into --out-dir, named after the common name (www.example.com becomes www_example_com). The command line always writes the key as a file; keys in the Windows key store are created with the desktop app's Create CSR.

FlagWhat it does
--profile server|user|codesignWhat the certificate is for. Default server.
--cn <name>Common name: the host name (server), the person (user) or the publisher (code signing). Required.
--san <name>Additional subject alternative name - host names and IPs for a server, e-mail addresses for a user. Repeatable or comma-separated. --email is an alias.
--ip <address>IP address SAN for a server, for clients that connect by address. Repeatable or comma-separated.
--upn <upn>User principal name for the user profile, e.g. [email protected].
--org, --ou, --locality, --stateSubject fields.
--country <cc>Two-letter country code.
--key rsa2048|rsa3072|rsa4096|p256|p384Key type. Default rsa2048.
--out-dir <dir>Where to write the files. Default: the current directory.
--encrypt-keyEncrypt the private key; the password is prompted for.
--key-password-env <VAR>Read the key password from this environment variable (implies --encrypt-key).
--self-signedIssue a self-signed certificate instead of only a request; also writes <name>.crt.
--days <n>Validity of --self-signed in days. Default 365.
--pfxWith --self-signed: also write <name>.pfx.
--pfx-password-env <VAR>PFX password from this environment variable.
--forceOverwrite existing files.
--opensslPrint the equivalent OpenSSL command and exit.
# Server CSR with SANs and an IP, key encrypted
actk csr --cn www.example.com --san example.com --ip 10.0.0.15 --org "Example GmbH" `
  --locality München --state Bayern --country DE --key rsa2048 --encrypt-key

# User certificate (S/MIME + client authentication)
actk csr --profile user --cn "Erika Mustermann" --email [email protected] --upn [email protected]

# Self-signed code signing certificate for testing, with a PFX
actk csr --profile codesign --cn "Example GmbH" --org "Example GmbH" --country DE --key rsa3072 `
  --self-signed --days 365 --pfx

actk decode

actk decode <file>

Shows subject, SANs, key, requested usage, the proof-of-possession signature and every finding. PEM or DER. Exits 1 when a finding is an error - so a script can stop before it submits a request a CA would reject. See Check CSR.

actk pfx

actk pfx --cert <file> --key <file> --out <file> [options]
FlagWhat it does
--cert <file>The issued certificate, optionally with its chain. Required.
--chain <file>Additional chain files (intermediates). Repeatable.
--key <file>The private key: PKCS#8, encrypted PKCS#8 or PKCS#1 PEM. Required.
--key-password-env <VAR>Password of an encrypted key.
--out <file>The PFX to write. Required.
--password-env <VAR>PFX password from this environment variable instead of a prompt.
--friendly-name <name>The name Windows shows for the certificate.
--legacy3DES/SHA-1 encryption for Windows Server 2016 and older.

The key is checked against the certificate before anything is written.

actk pfx --cert issued.pem --chain intermediate.pem --key www_example_com.key --out www.pfx

actk export

actk export --cert <file> | --pfx <file> [outputs] [options]
FlagWhat it does
--cert <file>Certificate file (PEM or DER), optionally with its chain.
--chain <file>Additional chain files. Repeatable.
--key <file>The private key - only needed for --key-out.
--key-password-env <VAR>Password of an encrypted key.
--pfx <file>Read certificate, chain and key from a PFX instead.
--pfx-password-env <VAR>PFX password from this environment variable.
--cer <file>Write the leaf certificate as DER.
--crt <file>Write the leaf certificate as Base64 PEM.
--fullchain <file>Write leaf and chain as PEM.
--chain-out <file>Write the chain without the leaf as PEM.
--key-out <file>Write the private key (PKCS#8 PEM).
--encrypt-keyEncrypt --key-out; the password is prompted for.
--forceOverwrite existing files.
actk export --cert issued.pem --chain intermediate.pem --cer www.cer --fullchain fullchain.pem
actk export --pfx from-iis.pfx --crt www.crt --chain-out chain.pem --key-out www.key

actk sign

actk sign <files...> --thumbprint <sha1> | --pfx <file> [options]
FlagWhat it does
--thumbprint <sha1>A certificate from the Windows store, by thumbprint - see actk certs.
--pfx <file>Certificate and key from a PFX file instead.
--password-env <VAR>PFX password from this environment variable.
--timestamp <url>RFC 3161 timestamp server. Default http://timestamp.digicert.com.
--no-timestampSign without a timestamp: the signature then expires with the certificate.

Every file is verified after signing, with the same exit code as actk verify. Windows-only.

actk sign Setup.exe deploy.ps1 package.msi --thumbprint 0123ABCD...
actk sign tool.exe --pfx codesign.pfx --timestamp http://timestamp.sectigo.com

actk verify

actk verify <files...>

Shows the Authenticode signature status, signer and timestamp of each file. Exits 1 if a file is not signed, was modified after signing, or Windows reports an error; a valid signature whose root this computer does not trust is shown, but does not fail. Windows-only.

actk certs

actk certs

Lists the certificates Windows can sign code with - Code Signing purpose and a private key, in the user's and the computer's store, including USB tokens and HSMs - with their thumbprints for actk sign. Windows-only.

actk store

actk store list [--machine]
actk store import <file> [--key <file>] [options] [--machine]
actk store export <thumbprint> [outputs] [options] [--machine]
actk store delete <thumbprint> [--yes] [--machine]

The personal store of the current user (CurrentUser\My), or with --machine the computer's (LocalMachine\My). Changing the computer's store needs an elevated prompt. Windows-only.

import - an issued certificate (.cer, .crt, .pem, .p7b) with the key from actk csr, or a .pfx/.p12. Intermediates go to Intermediate Certification Authorities; a root is never installed.

FlagWhat it does
--key <file>The private key from actk csr for this certificate.
--key-password-env <VAR>Password of an encrypted key.
--pfx-password-env <VAR>PFX password from this environment variable.
--not-exportableMark the private key as not exportable.
--friendly-name <name>The name Windows shows.

export - a certificate by thumbprint, with its chain, and its key for --pfx and --key-out.

FlagWhat it does
--pfx <file>Write a PFX (certificate, chain, key).
--password-env <VAR>PFX/key password from this environment variable.
--legacy3DES/SHA-1 PFX for Windows Server 2016 and older.
--cer, --crt, --fullchain, --chain-out, --key-out <file>The same outputs as actk export.
--encrypt-keyEncrypt --key-out with the password.
--forceOverwrite existing files.

delete - removes the certificate and its private key. Asks for confirmation unless --yes is given.

actk store list
actk store import issued.p7b --key www_example_com.key
actk store export 0123ABCD... --pfx www.pfx --fullchain fullchain.pem
actk store delete 0123ABCD...

actk scan

actk scan <targets...> [options]

Targets are hosts, CIDR networks (up to /16) and ranges: 10.0.0.0/24, 10.0.0.10-50, srv01.corp.local. At most 65,536 addresses and 262,144 probes per scan.

FlagWhat it does
-p, --ports <list>Ports and ranges, e.g. 443,636,8000-8100. Default 443.
--sni <name>Server name to send to IP targets.
--concurrency <n>Parallel connections. Default 64.
--timeout <s>Connect timeout in seconds. Default 3.
--no-starttlsTreat every port as implicit TLS - no STARTTLS or RDP negotiation.
--tls-onlyOnly list endpoints with a certificate.
--csv <file>Write the inventory as CSV.
--json <file>Write the inventory as JSON (aethercert.toolkit.cert-scan/v1).
--ca-file <file>Extra trusted roots, PEM - e.g. an internal CA not installed here.
--no-system-storeDo not trust the Windows certificate store.
actk scan 10.0.0.0/24 10.0.1.10-50 srv01.corp.local -p 443,636,3389,8443 `
  --csv inventory.csv --json inventory.json

See Certificate scanner.

actk security

actk security <target> [options]

The target is host, host:port or https://host:port/path.

FlagWhat it does
--port <n>Port, if not part of the target.
--sni <name>Name to check the certificate against when the target is an IP.
--transport auto|tls|smtp|imap|pop3|ftp|rdpHow to start TLS. Default auto (by port).
--no-headersSkip the HTTP security-headers check.
--json <file>Write the result as JSON (aethercert.toolkit.security-scan/v1).
--ca-file <file>Extra trusted roots, PEM.
--no-system-storeDo not trust the Windows certificate store.
actk security intranet.corp.local:8443 --json report.json
actk security 10.0.0.25:25           # SMTP STARTTLS, detected from the port

Exits 1 when the scan could not complete. See Security scan.

On this page