summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/transport.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 99fd09a1b..2eeebd565 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -108,6 +108,13 @@ typedef enum {
* it will ask via this credential type.
*/
GIT_CREDTYPE_USERNAME = (1u << 5),
+
+ /**
+ * Credentials read from memory.
+ *
+ * Only available for libssh2+OpenSSL for now.
+ */
+ GIT_CREDTYPE_SSH_MEMORY = (1u << 6),
} git_credtype_t;
/* The base structure for all credential types */
@@ -291,6 +298,23 @@ GIT_EXTERN(int) git_cred_default_new(git_cred **out);
GIT_EXTERN(int) git_cred_username_new(git_cred **cred, const char *username);
/**
+ * Create a new ssh key credential object reading the keys from memory.
+ *
+ * @param out The newly created credential object.
+ * @param username username to use to authenticate.
+ * @param publickey The public key of the credential.
+ * @param privatekey The private key of the credential.
+ * @param passphrase The passphrase of the credential.
+ * @return 0 for success or an error code for failure
+ */
+GIT_EXTERN(int) git_cred_ssh_key_memory_new(
+ git_cred **out,
+ const char *username,
+ const char *publickey,
+ const char *privatekey,
+ const char *passphrase);
+
+/**
* Signature of a function which acquires a credential object.
*
* - cred: The newly created credential object.