SOPV(1)

πŸ“¦
version 1.1.1 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

SOPV(1) β€” Stateless OpenPGP Signature Verification

okay bestie, welcome to sopv πŸ’– this is the verification-only slice of the whole thing, and yes the manual name is right there in the title, we're not being weird about it.


✨ NAME ✨

sopv β€” verify OpenPGP signatures 🫢


✨ SYNOPSIS ✨

sopv [--debug] subcommand

✨ DESCRIPTION ✨

so like, sopv is the verification-only subset of the OpenPGP Stateless Command Line Interface β€” you might know it as "SOP" πŸ’…

sopv was literally built to verify OpenPGP signatures. That's the whole vibe. It handles detached signatures and inline signatures, no problem. And how does it know who's allowed to have signed? You, the caller, hand it a set of OpenPGP certificates. That's the guest list. If you're not on it, you're not getting in 🚫✨


✨ EXAMPLES ✨

first up, the lil "who even are you" check:

$ sopv version
ExampleSop 2.3.0

then a detached signature verification, classic:

$ sopv verify libfoo-3.1.2.tgz.sig libfoo-keys.pgp < libfoo-3.1.2.tgz
2025-02-03T0:02:25Z 8CD219FC05D9DE9F3D59B784160B8EF5536B0D27 8CD219FC05D9DE9F3D59B784160B8EF5536B0D27 mode:binary {"signers":["libfoo-keys.pgp"]}

and an inline verify, with the receipts saved to a file 😌

$ sopv inline-verify --verifications-out=verifs.txt alice.cert < alice-message.csf
This is a message from Alice
$ cat verifs.txt
2025-02-13T00:04:49Z 63339423454CA210DAA886C08723C4D38E0802F6 F255F2A602AC1DFF2331085E5DAE32C783FC418D mode:text {"signers":["alice.cert"]}
$

want to do a thing only when a detached signature is valid? say less:

if sopv verify libfoo-3.1.2.tgz.sig libfoo-keys.pgp < libfoo-3.1.2.tgz > /dev/null; then
  # The software was signed correctly ...
fi

and same energy, but inline this time:

if sopv inline-verify alice.cert < alice-message.csf > alice.message; then
  # alice.message is data that was signed by alice ...
fi

✨ SUBCOMMANDS ✨

Exactly one subcommand must be supplied. one. not zero. not two. exactly one, bestie πŸ™ˆ
  • sopv version β€” get all the version / build / compatibility info about the sopv implementation you're running. more deets in sopv-version(1) ✨
  • sopv verify β€” verify detached OpenPGP signatures over a message. more deets in sopv-verify(1) πŸ’–
  • sopv inline-verify β€” verify an inline-signed OpenPGP message. more deets in sopv-inline-verify(1) πŸ¦‹

✨ COMMON OPTIONS ✨

every single sopv subcommand accepts this one, no exceptions:

  • --debug β€” emits more detailed output on standard error, if available. key phrase: if available. don't come for me if it's quiet πŸ’€

each subcommand also has its own distinct options and arguments β€” go read the matching manual page, iykyk πŸ‘‘


✨ INPUT DATA TYPES ✨

some sopv subcommands take these data types as inputs β€” either as arguments or straight off standard input. let's get into it:

  • DATE β€” dates are given directly in ISO-8601-compliant format, in UTC with the Z suffix. like, for example, 2025-02-12T05:22:33Z ⭐
  • CERTS β€” a collection of OpenPGP certificates, also known as "Transferable Public Keys". each CERTS input may be unarmored, or may use OpenPGP ASCII armor πŸŽ€
  • SIGNATURES β€” a collection of OpenPGP signatures. each individual SIGNATURES input may be unarmored, or may use OpenPGP ASCII armor πŸ’œ
  • INLINESIGNED β€” an OpenPGP Signed Message, or a text document that is signed internally with the OpenPGP Cleartext Signing Framework. an OpenPGP Signed Message input may be unarmored, or may use OpenPGP ASCII armor 🌸

✨ VERIFICATIONS ✨

sometimes sopv emits a VERIFICATIONS text stream, and it's lowkey iconic β€” it holds a concise description of every valid OpenPGP signature it discovered πŸ‘‘

every line in a VERIFICATIONS stream = one valid signature from an acceptable signer. there are at least three fixed fields, separated from each other β€” and from the final optional fields β€” by whitespace.

the fields, in order:

  • timestamp β€” the time of the signature, in ISO-8601 date format, in UTC ⏰
  • signing_key_fingerprint β€” the fingerprint of the signing key (may be a primary key, or a signing-capable subkey)
  • primary_key_fingerprint β€” the fingerprint of the primary key of the OpenPGP certificate that contains the signing key (may be the same as the signing key) πŸ”‘
  • signing_mode β€” this optional field is either mode:text or mode:binary πŸ’…
  • optional_additional_data β€” if signing_mode is present, the final optional field extends to the end of the line, and is either free-form text or a JSON object. if it starts with { it's a JSON object. that JSON object may contain a "signers" member, which is a JSON list of the names of each CERTS object that could have authored the signature 🫢

✨ SPECIAL DESIGNATORS ✨

anywhere a CERTS, SIGNATURES, or VERIFICATIONS object gets pointed to on the command line, it's typically given as a path to a filename. but also? sopv should accept a special designator, which is any string starting with a @ character 🌈

there are two established kinds of special designator:

  • @FD:nnn β€” this means read from, or write to, the file descriptor identified numerically by nnn. ngl this is also a valid argument for --verifications-out in sop inline-verify β€” you can use it there to run sopv on an entirely read-only filesystem πŸ‘‘
  • @ENV:varname β€” this means read the value from the environment variable named varname. heads up: typically only text-based data can travel this way, so a CERTS argument should be armored, for example. also note this can only be used for input to sopv, never output β€” because sopv can't set the values in its callers' environment, bestie, it's not a wizard 🧚
if you want to refer to a file in the filesystem whose name actually begins with an @ (like, say, @foo), you should indicate that file to sopv using ./@foo to avoid an AMBIGUOUS_INPUT error ⚠️

✨ VERSION HISTORY ✨

the sopv specification keeps a version history similar to semantic versioning β€” https://semver.org/ πŸ’– implementations indicate their compliance with a specific level of the spec with sopv version --sopv (peep sopv-version(1)).

  • 1.1 β€” everything from 1.0. additionally, the VERIFICATIONS output includes the fourth field (signing_mode), and the final field of VERIFICATIONS is a JSON object containing at least a "signers" member as described above ✨
  • 1.0 β€” the subcommands version, verify, and inline-verify. the common argument --debug (even if it produces no additional messages to stderr). sopv version arguments --extended, --sop-spec, --backend, --sopv. for sopv verify and sopv inline-verify, the arguments --not-before and --not-after. for sopv inline-verify, the --verifications-out argument. special designators @ENV: and @FD: for any CERTS and SIGNATURES input. special designator @FD: for any VERIFICATIONS output. at least the first three fields in any VERIFICATIONS output πŸŽ€

πŸ’– RETURN CODES πŸ’–

okay bestie, so sopv tells you it worked by returning 0. that's the good ending, that's the slay.

A failure? That's any non-zero return code, and honestly the codes are kinda specific so you can lowkey tell what went wrong. Here's the whole roster, no skips:

  • 0 β€” mnemonic OK β€” success. periodt. ✨
  • 1 β€” mnemonic UNSPECIFIED_FAILURE β€” something failed and it's not saying what. an otherwise unspecified failure occurred. it's giving mystery πŸ•΅οΈ
  • 3 β€” mnemonic NO_SIGNATURE β€” no acceptable signatures found. nobody signed this, or nobody signed it in a way we accept. 😭
  • 19 β€” mnemonic MISSING_ARG β€” missing required argument. you forgot something, bestie πŸ™ˆ
  • 37 β€” mnemonic UNSUPPORTED_OPTION β€” unsupported option. that flag is not it πŸ’€
  • 41 β€” mnemonic BAD_DATA β€” invalid data type (like a secret key where CERTS were expected, etc). wrong vibe entirely
  • 59 β€” mnemonic OUTPUT_EXISTS β€” output file already exists. it's already there, we're not overwriting
  • 61 β€” mnemonic MISSING_INPUT β€” input file does not exist. can't read what isn't there πŸ¦‹
  • 69 β€” mnemonic UNSUPPORTED_SUBCOMMAND β€” unsupported subcommand. not a thing, sorry
  • 71 β€” mnemonic UNSUPPORTED_SPECIAL_PREFIX β€” sopv does not know how to handle the special designator. it looked at the prefix and was like... no thoughts
  • 73 β€” mnemonic AMBIGUOUS_INPUT β€” a file with the name of the special designator is present. so like, both things are true at once and it can't pick πŸ‘‘
Also, ngl, details about warnings or errors may also be emitted to standard error. so keep an eye on stderr, bestie, that's where the tea gets spilled β˜•

πŸ‘‘ AUTHOR πŸ‘‘

This manual page was written by Daniel Kahn Gillmor. Your implementation of sopv is likely written by someone else in alignment with the SOP specification. Please run sopv version to learn more about your implementation. 🫢


🌈 SEE ALSO 🌈


and that's the whole page, bestie πŸ’… you're now officially fluent in sopv. this was sopv version 1.1, dated March 2025, and yes it's the SOPV(1) page β€” go forth and verify things. slay πŸ’–βœ¨

πŸ“¦ where this page comes from