unlock_gpg_key_passphrase {knitrdata}R Documentation

Functions that attempts to unlock a gpg key for decryption

Description

This function will attempt to unlock a specific GPG key by first encrypting a small amount of information using the (public) key and then immediately decrypting it using the (private) key, thereby causing the keyring to temporarily store the key passphrase. This can be helpful if one is trying to knit a document with encrypted data chunks, but the key for those data chunks is locked with a passphrase. See the package vignette section Workarounds for GPG data chunk error: Password callback did not return a string value for more details.

Usage

unlock_gpg_key_passphrase(
  id = ifelse(is.null(name), ifelse(is.null(email), NULL,
    gpg::gpg_list_keys()$id[gpg::gpg_list_keys()$email == email]),
    gpg::gpg_list_keys()$id[gpg::gpg_list_keys()$name == name]),
  name = NULL,
  email = NULL
)

Arguments

id

Identifier of the GPG key

name

Name associated with the desired GPG key

email

Email associated with the desired GPG key

Value

Will return the identifier of the GPG key that was unlocked.

Author(s)

David M. Kaplan dmkaplan2000@gmail.com

See Also

See also data_encode, gpg_encrypt.


[Package knitrdata version 0.6.1 Index]