Rev 89692 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/tools/man/checkMD5sums.Rd% Part of the R package, https://www.R-project.org% Copyright 1995-2026 R Core Team% Distributed under GPL 2 or later\name{checkSHA256sums}\alias{checkSHA256sums}\alias{verifySHA256signature}\title{Check and Create \file{SHA256} Checksum Files}\description{\code{checkSHA256sums} checks the files against a file \file{SHA256}.\code{verifySHA256signature} implies \code{checkSHA256sums} but alsoverifies GnuPG detached signature in file \file{SHA256.sig}.}\usage{checkSHA256sums(package, dir)verifySHA256signature(package, dir)}\arguments{\item{package}{the name of an installed package}\item{dir}{the path to the top-level directory of an installedpackage.}}\details{The file \file{SHA256} which is a text file with the followingentries separated by a single space each: hash (64-digit hexadecimalrepresentation of the \acronym{SHA}-256 hash), size of the file inbytes and the file path.If \code{dir} is missing, an installed package of name \code{package}is searched for.The private function \code{tools:::.installSHA256sums} is used to create\file{SHA256} files.\code{verifySHA256signature} relies on the GnuPG (\acronym{GPG}) toolto perform the verification. The environment variable \env{GPG} canoverride the default command \command{gpg}.In order to ascertain the validity of a signature, it is necessary toobtain the public key of the signer and add it to a keyring fortrust. \code{verifySHA256signature} will first look for any files inthe \code{file.path(R.home("etc"), "keyrings")} directory with\file{.gpg} extensions (if they exist) and any keyrings inthe \file{~/.R/keyrings} user directory. If this yields no successthen the user's default GnuPG keyring is consulted, including anylocal user settings.}\value{\code{checkSHA256sums} returns a logical, \code{NA} if there is no\file{SHA256} file to be checked.\code{verifySHA256signature} returns a logical, \code{NA} if there isno \file{SHA256.sig} file to be checked or if GnuPG is not availablefor checking. If \code{TRUE} or \code{FALSE} then additionalinformation is supplied as a list in the \code{"result"}attribute. The attribute as well as its entries are consideredoptional, but most commonly populated values are:\item{fingerprint}{string, hexadecimal representation of thefingerprint of the public key that signed the signature}\item{keyid}{string, hexadecimal key id}\item{userid}{string, user id (typically name and e-mail address ofthe signer)}\item{ts}{\code{"\link{POSIXct}"}, timestamp of the signature}\item{missing.pubkey}{logical, \code{TRUE} if the signature cannot beverified due to missing public key corresponding to the signature}\I{OpenPGP} does not mandate the presence of any other fields insignatures other than \code{ts} and \code{keyid}, but most modernsignatures include the \code{fingerprint} and \code{userid}.}\seealso{\code{\link{sha256sum}}, \code{\link{checkMD5sums}}}\keyword{utilities}