summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorDavid Calavera <david.calavera@gmail.com>2015-03-17 09:19:15 -0700
committerMichał Górny <mgorny@gentoo.org>2015-05-27 20:36:53 +0200
commit7a8b85032f4390b6b14e55e0074d864fe742ca3b (patch)
tree2cfb2fb205b512452aac8826911935ff1271ea02 /include/git2
parentc11daac9de2fb582873e2471346526f33835226e (diff)
downloadlibgit2-7a8b85032f4390b6b14e55e0074d864fe742ca3b.tar.gz
Add support to read ssh keys from memory.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/transport.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 99fd09a1b..57293d92f 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -108,6 +108,15 @@ typedef enum {
* it will ask via this credential type.
*/
GIT_CREDTYPE_USERNAME = (1u << 5),
+
+#ifdef GIT_SSH_MEMORY_CREDENTIALS
+ /**
+ * Credentials read from memory.
+ *
+ * Only available for libssh2+OpenSSL for now.
+ */
+ GIT_CREDTYPE_SSH_MEMORY = (1u << 6),
+#endif
} git_credtype_t;
/* The base structure for all credential types */
@@ -290,6 +299,25 @@ GIT_EXTERN(int) git_cred_default_new(git_cred **out);
*/
GIT_EXTERN(int) git_cred_username_new(git_cred **cred, const char *username);
+#ifdef GIT_SSH_MEMORY_CREDENTIALS
+/**
+ * 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);
+#endif
+
/**
* Signature of a function which acquires a credential object.
*