LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

certutil

NSS certificate database management

TLDR

List certificates in database
$ certutil -L -d [~/.pki/nssdb]
copy
Add certificate to database
$ certutil -A -n "[alias]" -t "CT,," -d [~/.pki/nssdb] -i [cert.pem]
copy
Generate key pair
$ certutil -G -d [~/.pki/nssdb] -n "[keyname]"
copy
Delete certificate
$ certutil -D -n "[alias]" -d [~/.pki/nssdb]
copy
Create self-signed certificate
$ certutil -S -n "[alias]" -x -t "CT,," -d [~/.pki/nssdb] -s "CN=[hostname]"
copy
Display certificate details
$ certutil -L -d [~/.pki/nssdb] -n "[alias]"
copy

SYNOPSIS

certutil [options]

DESCRIPTION

certutil manages keys and certificates in NSS (Network Security Services) databases. It creates, modifies, lists, and deletes certificates and key pairs used by applications built on the NSS library, including Firefox, Thunderbird, and Chromium-based browsers.NSS databases store certificates in a directory-based format, with modern versions using SQLite (specified with the `sql:` prefix). The tool handles the full certificate lifecycle including generating key pairs, creating self-signed certificates, importing CA certificates, and managing trust flags that control how certificates are used for SSL, email signing, and code signing.Trust flags follow the format "SSL,Email,Object Signing" where `C` marks a trusted CA and `T` marks a certificate trusted for client authentication.

PARAMETERS

-A

Add certificate to database
-D
Delete certificate from database
-L
List certificates
-G
Generate new key pair
-S
Create and add self-signed certificate
-R
Generate certificate request
-C
Create certificate from request
-K
List keys in database
-d dir
Database directory (use sql: prefix for SQLite)
-n name
Certificate nickname/alias
-t trust
Trust flags (e.g., "CT,,")
-i file
Input file
-o file
Output file
-x
Self-sign certificate
-s subject
Subject DN string
-v months
Validity period in months

DATABASE TYPES

sql:dir: SQLite database (preferred)dbm:dir: Legacy BerkeleyDB format

TRUST FLAGS

Format: "SSL,Email,Object Signing" (e.g., "CT,,")C: Trusted CAT: Trusted for client authp: Valid peer

INSTALL

sudo apt install libnss3-tools
copy
sudo dnf install nss-tools
copy
sudo apk add nss-tools
copy

CAVEATS

Requires nss-tools package. Use sql: prefix for modern databases. Handles sensitive keys; run with minimal privileges.

SEE ALSO

openssl(1), modutil(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid