FSVERITY(1) | User Commands | FSVERITY(1) |
fsverity - userspace utility for fs-verity
fsverity digest [OPTION...] FILE...
fsverity dump_metadata [OPTION...] TYPE FILE
fsverity enable [OPTION...] FILE
fsverity measure FILE...
fsverity sign [OPTION...] FILE OUT_SIGFILE
fsverity is a userspace utility for fs-verity. fs-verity is a Linux kernel filesystem feature that does transparent on-demand verification of the contents of read-only files using Merkle trees.
fsverity can enable fs-verity on files, retrieve the digests of fs-verity files, and sign files for use with fs-verity (among other things). fsverity’s functionality is divided among various subcommands.
This manual page focuses on documenting all fsverity subcommands and options. For examples and more information about the fs-verity kernel feature, see the references at the end of this page.
fsverity always accepts the following options:
Compute the fs-verity digest of the given file(s). This is mainly intended to used in preparation for signing the digest. In some cases fsverity sign can be used instead to digest and sign the file in one step.
Options accepted by fsverity digest:
Normally this option isn’t useful, but it can be needed in cases where the fs-verity metadata needs to be consumed by something other than one of the native Linux kernel implementations of fs-verity. This is not needed for file signing.
Normally this option isn’t useful, but it can be needed in cases where the fs-verity metadata needs to be consumed by something other than one of the native Linux kernel implementations of fs-verity. This is not needed for file signing.
Dump the fs-verity metadata of the given file. The file must have fs-verity enabled, and the filesystem must support the FS_IOC_READ_VERITY_METADATA ioctl (it was added in Linux v5.12). This subcommand normally isn’t useful, but it can be useful in cases where a userspace server program is serving a verity file to a client which implements fs-verity compatible verification.
TYPE may be “merkle_tree”, “descriptor”, or “signature”, indicating the type of metadata to dump. “signature” refers to the built-in signature, if present; userspace-managed signatures will not be included.
Options accepted by fsverity dump_metadata:
Enable fs-verity on the specified file. This will only work if the filesystem supports fs-verity.
Options accepted by fsverity enable:
Note that this option is only needed if the Linux kernel’s fs-verity built-in signature verification support is being used. It is not needed if the signatures will be verified in userspace, as in that case the signatures should be stored separately.
Display the fs-verity digest of the given file(s). The files must have fs-verity enabled. The output will be the same as fsverity digest with the appropriate parameters, but fsverity measure will take constant time for each file regardless of the size of the file.
fsverity measure does not accept any options.
Sign the given file for fs-verity, in a way that is compatible with the Linux kernel’s fs-verity built-in signature verification support. The signature will be written to OUT_SIGFILE in PKCS#7 DER format.
The private key can be specified either by key file or by PKCS#11 token. To use a key file, provide --key and optionally --cert. To use a PKCS#11 token, provide --pkcs11-engine, --pkcs11-module, --cert, and optionally --pkcs11-keyid. PKCS#11 token support is unavailable when fsverity-utils was built with BoringSSL rather than OpenSSL.
fsverity sign should only be used if you need compatibility with fs-verity built-in signatures. It is not the only way to do signatures with fs-verity. For more information, see the fsverity-utils README.
Options accepted by fsverity sign:
For example commands and more information, see the README file for fsverity-utils (https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/fsverity-utils.git/tree/README.md).
Also see the kernel documentation for fs-verity (https://www.kernel.org/doc/html/latest/filesystems/fsverity.html).
February 2022 | fsverity-utils v1.5 |