cred_ssh_key: Create a new passphrase-protected ssh key credential object

Description Usage Arguments Value See Also Examples

View source: R/credential.R

Description

Create a new passphrase-protected ssh key credential object

Usage

1
2
3
4
5
cred_ssh_key(
  publickey = ssh_path("id_rsa.pub"),
  privatekey = ssh_path("id_rsa"),
  passphrase = character(0)
)

Arguments

publickey

The path to the public key of the credential. Default is ssh_path("id_rsa.pub")

privatekey

The path to the private key of the credential. Default is ssh_path("id_rsa")

passphrase

The passphrase of the credential. Default is character(0). If getPass is installed and private key is passphrase protected getPass::getPass() will be called to allow for interactive and obfuscated interactive input of the passphrase.

Value

A list of class cred_ssh_key with entries:

publickey

The path to the public key of the credential

privatekey

The path to the private key of the credential

passphrase

The passphrase of the credential

See Also

Other git credential functions: cred_env(), cred_token(), cred_user_pass()

Examples

1
2
3
4
5
6
7
8
## Not run: 
## Create a ssh key credential object. It can optionally be
## passphrase-protected
cred <- cred_ssh_key(ssh_path("id_rsa.pub"), ssh_path("id_rsa"))
repo <- repository("git2r")
push(repo, credentials = cred)

## End(Not run)

git2r documentation built on Jan. 13, 2021, 8:40 a.m.

Related to cred_ssh_key in git2r...