Cred.defaultNew Sync

var cred = Cred.defaultNew();
Returns  
Cred  

Cred.sshKeyFromAgent Sync

var cred = Cred.sshKeyFromAgent(username);
Parameters Type  
username String username to use to authenticate
Returns  
Cred The newly created credential object.

Cred.sshKeyMemoryNew Async

Cred.sshKeyMemoryNew(username, publickey, privatekey, passphrase).then(function(cred) {
  // Use cred
});
Parameters Type  
username String username to use to authenticate.
publickey String The public key of the credential.
privatekey String The private key of the credential.
passphrase String The passphrase of the credential.
Returns  
Cred The newly created credential object.

Cred.sshKeyNew Sync

var cred = Cred.sshKeyNew(username, publickey, privatekey, passphrase);
Parameters Type  
username String username to use to authenticate
publickey String The path to the public key of the credential.
privatekey String The path to the private key of the credential.
passphrase String The passphrase of the credential.
Returns  
Cred The newly created credential object.

Cred.usernameNew Async

Cred.usernameNew(username).then(function(cred) {
  // Use cred
});
Parameters Type  
username String  
Returns  
Cred  

Cred.userpassPlaintextNew Sync

var cred = Cred.userpassPlaintextNew(username, password);
Parameters Type  
username String The username of the credential.
password String The password of the credential.
Returns  
Cred The newly created credential object.

Cred#free Sync

cred.free();

Cred#hasUsername Sync

var result = cred.hasUsername();
Returns  
Number 1 if the credential object has non-NULL username, 0 otherwise

Cred.TYPE ENUM

Flag Value
Cred.TYPE.USERPASS_PLAINTEXT 1
Cred.TYPE.SSH_KEY 2
Cred.TYPE.SSH_CUSTOM 4
Cred.TYPE.DEFAULT 8
Cred.TYPE.SSH_INTERACTIVE 16
Cred.TYPE.USERNAME 32
Cred.TYPE.SSH_MEMORY 64