This function tries to reverse the process of enc and hence depend on the conventions used there.

dec(tarfile, keyfile = "~/.ssh/id_rsa", target_dir = ".")

## Arguments

tarfile Character string providing full path to the gzip-compressed tarball holding the shipment payload, including encrypted files Character string providing the full path to the private RSA key to be used for decryption of the encrypted key that is part of the shipment. Default value is set to ~/.ssh/id_rsa which is the usual path for unix type operating systems. Character string providing the full path to where the decrypted file is to be written. Defaults to the current directory ".", e.g. where this function is being called from.

## Value

Invisibly a character string providing the file path of the decrypted file.

## Details

Some of the functions used here might be vulnerable to differences between systems running R. Possible caveats may be the availability of the (un)tar-function and how binary streams/files are treated.

## Examples

# Make temporary workspace
wd <- tempdir()

# Make a private-public key pair named "id_rsa" and "id_rsa.pub"
sship_keygen(directory = wd)
#> sship: Key pair written to /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmphfOHqM

# Make a secured (encrypted) file
saveRDS(iris, file = file.path(wd, "secret.rds"), ascii = TRUE)