pki_enable_download_file: Set download.file parameters

Description Usage Arguments Details Examples

View source: R/pki_enable_download_file.R

Description

Override default configuration settings used by download.file() to allow for PKI-enabled use of install.packages().

Usage

1
2
3
4
5
6
pki_enable_download_file(
  pki_file = NULL,
  ca_file = NULL,
  password = NULL,
  override = FALSE
)

Arguments

pki_file

string: filepath to a pki certificate

ca_file

string: filepath to a Certificate Authority (CA) bundle

password

string: passphrase used to encrypt/decrypt the PKI certificate

override

logical: force overwrite a pre-existing mypki configuration file if found.

Details

Default mypki configuration settings will be used unless otherwise specified. The PKI certificate file must be in PKCS#12 format. The arguments of download.file() are modified so that method = "curl" and the following extra curl command-line arguments are set: cacert, cert, key, pass. See ?download.file for more information.

This download method requires curl to be installed and added to the PATH environment variable. This is already done for most Linux/Mac distributions.

If a mypki configuration file cannot be found, users are prompted for filepaths to a PKI certificate and a Certificate Authority (CA) bundle.

Examples

1
2
3
4
5
6
7
8
9
library(rpki)
pki_enable_download_file() # will prompt for passphrase
install.packages("my_private_package")

library(rpki)
pki_enable_download_file(pki_file = "my_pki.p12",
                         ca_file = "my_ca.crt",
                         password = "my_pki_passphrase")
install.packages("my_private_package")

nbgallery/rpki documentation built on Sept. 2, 2020, 2:08 a.m.