back

apt-key

Manage pgp keys for signed apt packages

Overview

  • This module manages the presence of pgp keys used by apt to verify packages.

Form

(apt-key command & [opts])

Arguments

command

The overall command to execute. Should be one of :list, :present or :absent

:list

Lists the presently installed pgp keys

:present

Ensure the specified pgp key is present on the machine

:absent

Ensure the specified pgp key is absent on the machine

options

A hashmap of options

Options

OptionDescription
:public-key
required true
type string

    The contents of the gpg public key.

    Supply a string in PEM format.

:public-key-url
required true
type string

    A URL to download the public key from.

    Should return the key as it would be supplied to :public-key.

:fingerprint
required true
type string

    The gpg key fingerprint of the key to be installed or removed.

:keyring
required true
type string

    An optional keyring file path to place the key in.

Examples

Add the goaccess apt-key (following https://goaccess.io/download#official-repo)

(apt-key :present {:public-key-url "https://deb.goaccess.io/gnugpg.key"
                   :keyring "/etc/apt/trusted.gpg.d/goaccess.gpg"
                   :fingerprint "C03B 4888 7D5E 56B0 4671 5D32 97BD 1A01 3344 9C3D"})

Remove the goaccess apt-key

(apt-key :absent {:fingerprint "C03B 4888 7D5E 56B0 4671 5D32 97BD 1A01 3344 9C3D"})

List all installed apt-keys

(apt-key :list)