Skip to content

What this module does not do

A list of the things signing deliberately does not do, does not support, or does less of than the name suggests. Every entry is a real limit in the code, not a gap waiting to be filled; where something is genuinely planned, it says so.

If you are asking "can I…" and the answer here is no, that is the answer. The absence of a feature is rarely written down, which makes it the hardest thing to confirm from documentation.

It does not generate keys

There is no GenerateKey anywhere in the module. Every entry point takes a crypto.Signer you already hold. Generating an RSA or Ed25519 key pair, or provisioning one inside a KMS, happens before this module is involved: with openssl, your cloud provider's tooling, or a CLI built on top of this (the keys generate command from signing-cli, for one).

openpgpkey mints an OpenPGP public key from a signer you supply, which is a different thing: it wraps an existing key in the OpenPGP packet structure, User ID and self-signature that a verifier requires.

It does not ship a command-line tool

The module builds no binaries. Where the documentation mentions gtb sign or gtb keys mint, those commands come from signing-cli, a separate module of Cobra command builders, attached to a binary by go-tool-base. Installing this module gives you packages to import, nothing to run.

It does not read configuration or environment variables

Every setting is a plain Go struct field or function argument, populated by the calling program. There is no config-file loader, no env-var prefix and no flag parsing. That is deliberate: keeping a flag library out of the core is what lets a verify-only consumer import this with almost no dependency graph.

The one string it does parse is a --backend selector, in signing.Resolve, so that every host reads <type>:<instance>?key=value the same way. Resolve takes the string from the caller. It never reads the command line or the environment itself.

The four verify.Default* variables look like an exception and are not: nothing in this module reads them. They are compile-time knobs for a downstream self-updater to consult. See Limits, defaults and tunables.

It does not download releases or check asset hashes

verify verifies a detached signature over manifest bytes you already have. It does not fetch the manifest, fetch the signature, parse the manifest, or hash any asset. Comparing each downloaded asset against its manifest line is the caller's job, and skipping it means the signature has proved nothing about the assets themselves.

The only network call anywhere in the module is the WKD key fetch.

verify.ErrSignatureMissing, verify.ErrSignatureTooLarge and verify.MaxSignatureSize exist for a downstream release-fetcher and are never raised or read here.

Key types it refuses

Path Accepts Refuses
OpenPGP minting and signing (openpgpkey) RSA only Ed25519 and everything else, with ErrUnsupportedKeyType
minisign (minisign) Ed25519 only RSA and everything else, with its own ErrUnsupportedKeyType
Trust sets (verify) Ed25519, and RSA at 3072 bits or more DSA, ElGamal, ECDH, ECDSA, X25519, X448, Ed448, RSA-encrypt-only, RSA under 3072 bits, and any algorithm a future go-crypto adds
The local backend RSA (PKCS#1 or PKCS#8), ECDSA P-256 (PKCS#8 or SEC 1) and Ed25519 (PKCS#8) other ECDSA curves and anything else, with local.ErrUnsupportedKeyType

Two consequences worth spelling out. One key cannot serve both signing paths, so publishing OpenPGP manifests and minisign artefacts means holding two keys. And verify accepts Ed25519 keys into a trust set even though openpgpkey cannot mint one: an Ed25519 OpenPGP key produced elsewhere verifies here perfectly well.

ECDSA is refused on the OpenPGP and minisign paths on purpose, because no consumer of those formats checks it. The local backend accepts P-256 alone, for container image signing in the cosign formats, where it is the default key type (signature format family spec, D5).

The local backend will not read an encrypted PEM

It returns local.ErrEncryptedPEMUnsupported. The standard library exposes no clean PKCS#8 decryption path, so the backend refuses rather than half-supporting it. Decrypt out of band first, encrypt the file at the filesystem layer (LUKS, FileVault, age), or use a KMS backend where the key never lands on disk at all. Encrypted-PKCS#8 support would be purely additive and is slated for a later version if a real consumer asks.

The backend also reads whatever path it is handed, following symlinks, with no canonicalisation. That is appropriate for an operator-supplied path and worth knowing if the path could originate anywhere less trusted.

key_source: "both" does not guarantee a cross-check

This is the sharpest edge in the module.

Asking for "both" requests embedded and WKD anchors with a fingerprint cross-check between them. But BuildKeyResolver degrades to whichever single source is actually configured. Supply embedded keys and no ExternalKeyEmail, and you get a plain embedded resolver with no cross-check, no error and no warning. RequireExternalCrosscheck: true does not rescue it, because that flag is only consulted when a composite resolver is genuinely built.

The resulting configuration is not wrong (a single anchor is a legitimate choice), but it is not the guarantee the name implies. Check resolver.Name() for a composite[…] prefix if you need to know which you have. The full matrix is in Configuration fields.

Cross-checking has no quorum mode

CompositeResolver requires the fingerprint sets from every successful child to be identical. There is no m-of-n, no majority vote, no "two of these three must agree". Any divergence aborts with ErrKeyResolverMismatch.

And with only one successful child there is nothing to compare, so no cross-check runs at all. That is exactly what a fail-open composite does during a WKD outage: it degrades to a single anchor and logs a warning, if you gave it a logger.

WKD support stops well short of the whole specification

  • Only the two URL layouts are tried: advanced first, then direct, and the direct URL only when the advanced one returns HTTP 404. Any other failure is returned immediately.
  • There is no keyserver, HKP, DANE or gpg --recv-keys fallback. WKD is the only external anchor implemented.
  • Nothing is cached. Resolve performs its I/O on every call, so cache above the resolver if that matters.
  • Key submission is not implemented. WriteWKDTree can write a submission-address file advertising where submissions go, but nothing here sends or services one.
  • The default HTTP client sets a 30-second timeout and nothing else. It applies no redirect policy, so a redirect from the WKD host to an http:// URL will be followed, because the HTTPS check covers the initial URL only. Inject your own client to close that, along with any TLS floor or certificate pinning you want.

Rotation is a mechanism, not a policy

On the OpenPGP path, go-crypto does enforce what the key material itself says: a revoked primary key, a revoked identity, a revoked or expired signing subkey, an expired key or an expired signature all fail verification, judged against the current clock. All of them surface as ErrSignatureInvalid.

Beyond that, the module provides one mechanism: a rotation manifest, signed by a minisign authority key, that adds and revokes release keys on a binary already shipped (see Accept an emergency key rotation). A TrustSet is still immutable. The rotating resolver builds a new one from the agreed set and the stored record on each resolve.

What it does not provide is the policy around that mechanism:

  • No fetching. Finding a release's manifest and handing it to ApplyRotation is the updater's job.
  • No storage. RotationStore is an interface. MemoryRotationStore keeps nothing between runs, so a real binary needs its own. It must lock, or refuse a lower epoch, different keys at the same one, and a record that lacks a revoke already stored, because ApplyRotation does not serialise its load and save. A revoke is permanent, so the epoch alone does not stop two racing updates dropping one.
  • No issuing workflow. SignRotationManifest signs a manifest you have built. Choosing the epoch, carrying earlier adds and revokes forward, and refusing a replayed epoch are the issuing command's job.
  • No guard against a deliberate leak. An added key's armour must be the public key and nothing else, which stops a secret being published by accident. An issuer who hides one on purpose in a user ID or a signature's data is not stopped (see what an added key may hold).
  • No authority succession. Replacing the authority key means shipping a binary that embeds the new one.
  • No revocation-certificate distribution, and no reach into binaries that predate rotation. Deciding when to rotate, and telling users of older binaries, is yours.

On the minisign path there is no expiry or revocation at all: the format cannot express either.

It does not bound the data it signs

openpgpkey.DetachSign reads its entire io.Reader into memory. There is no size cap and no streaming path. For a checksums manifest of a few kilobytes that is fine; for input you did not produce, wrap the reader in an io.LimitReader yourself.

By contrast minisign.Sign does stream, so artefact size is not a concern there.

Registration is one-way and panics on error

signing.Register panics on a nil backend, an empty name, or a duplicate name, rather than returning an error, and signing.RegisterFactory panics on its own equivalents. There is no Unregister; ResetForTesting exists for tests and must not be called in production. Importing a backend package registers its default, so registering a configured backend under that same name as well panics on the duplicate.

signing.NewInstance builds a named instance and hands it back without registering it, so signing.Get and signing.Names never see it. Keeping it is the caller's job.

verify.NewEmbeddedResolver likewise panics on a malformed or weak key, because a bad embedded key must stop a binary at startup rather than at the first update attempt. BuildKeyResolver is the error-returning route to the same thing.

It does not protect against these at all

  • Confidentiality. This is integrity and authenticity. Manifests, signatures and public keys are not secret.
  • A compromised build pipeline. An attacker who controls the build that embeds your keys can embed theirs. The WKD cross-check exists because that assumption can fail; see Threat model.
  • A compromised verifying host. Nothing a signature check can do survives an attacker who already owns the machine running it.