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| Command | What it does |
|---|---|
csr | Create a private key and a certificate signing request (or a self-signed certificate). |
decode | Show what a CSR contains and whether a CA will accept it. |
pfx | Bundle an issued certificate and its chain with the key into a .pfx. |
export | Write a certificate file or a PFX as .cer, .crt/.pem, full chain, chain only or .key. |
sign | Authenticode-sign exe, dll, msi, PowerShell scripts and more. |
verify | Show the Authenticode signature of files. |
certs | List the code signing certificates in the Windows store, including USB tokens and HSMs. |
store | The personal certificates in the Windows store: list, import, export, delete. |
scan | Scan address ranges and ports for TLS certificates. |
security | Grade 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.
| Flag | What it does |
|---|---|
--profile server|user|codesign | What 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, --state | Subject fields. |
--country <cc> | Two-letter country code. |
--key rsa2048|rsa3072|rsa4096|p256|p384 | Key type. Default rsa2048. |
--out-dir <dir> | Where to write the files. Default: the current directory. |
--encrypt-key | Encrypt the private key; the password is prompted for. |
--key-password-env <VAR> | Read the key password from this environment variable (implies --encrypt-key). |
--self-signed | Issue a self-signed certificate instead of only a request; also writes <name>.crt. |
--days <n> | Validity of --self-signed in days. Default 365. |
--pfx | With --self-signed: also write <name>.pfx. |
--pfx-password-env <VAR> | PFX password from this environment variable. |
--force | Overwrite existing files. |
--openssl | Print 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 --pfxactk 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]| Flag | What 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. |
--legacy | 3DES/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.pfxactk export
actk export --cert <file> | --pfx <file> [outputs] [options]| Flag | What 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-key | Encrypt --key-out; the password is prompted for. |
--force | Overwrite 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.keyactk sign
actk sign <files...> --thumbprint <sha1> | --pfx <file> [options]| Flag | What 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-timestamp | Sign 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.comactk 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 certsLists 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.
| Flag | What 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-exportable | Mark 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.
| Flag | What it does |
|---|---|
--pfx <file> | Write a PFX (certificate, chain, key). |
--password-env <VAR> | PFX/key password from this environment variable. |
--legacy | 3DES/SHA-1 PFX for Windows Server 2016 and older. |
--cer, --crt, --fullchain, --chain-out, --key-out <file> | The same outputs as actk export. |
--encrypt-key | Encrypt --key-out with the password. |
--force | Overwrite 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.
| Flag | What 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-starttls | Treat every port as implicit TLS - no STARTTLS or RDP negotiation. |
--tls-only | Only 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-store | Do 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.jsonSee Certificate scanner.
actk security
actk security <target> [options]The target is host, host:port or https://host:port/path.
| Flag | What 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|rdp | How to start TLS. Default auto (by port). |
--no-headers | Skip 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-store | Do 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 portExits 1 when the scan could not complete. See Security scan.