Skip to content

Commit 6e4cb16

Browse files
authored
Added private key file formats and export to file format function for ssh.key. Resolves #96 (#98)
1 parent b566f44 commit 6e4cb16

File tree

5 files changed

+1586
-575
lines changed

5 files changed

+1586
-575
lines changed

Changelog.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Change Log
22
=============
33

4+
1.2.0
5+
++++++
6+
7+
Changes
8+
--------
9+
10+
* Added private key file formats to `ssh.key` and `ssh.key.Key.export_privkey_file_format` for exporting private key
11+
file with specified format - #96
12+
13+
14+
415
1.1.1
516
+++++
617

ssh/c_ssh.pxd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ cdef extern from "libssh/libssh.h" nogil:
183183
SSH_KEYTYPE_ECDSA_P384_CERT01,
184184
SSH_KEYTYPE_ECDSA_P521_CERT01,
185185
SSH_KEYTYPE_ED25519_CERT01
186+
enum ssh_file_format_e:
187+
SSH_FILE_FORMAT_DEFAULT
188+
SSH_FILE_FORMAT_OPENSSH
189+
SSH_FILE_FORMAT_PEM
186190
enum ssh_keycmp_e:
187191
SSH_KEY_CMP_PUBLIC,
188192
SSH_KEY_CMP_PRIVATE
@@ -438,6 +442,13 @@ cdef extern from "libssh/libssh.h" nogil:
438442
int ssh_pki_export_privkey_file(
439443
const ssh_key privkey, const char *passphrase,
440444
ssh_auth_callback auth_fn, void *auth_data, const char *filename)
445+
int ssh_pki_export_privkey_file_format(
446+
const ssh_key privkey,
447+
const char *passphrase,
448+
ssh_auth_callback auth_fn,
449+
void *auth_data,
450+
const char *filename,
451+
ssh_file_format_e format)
441452

442453
int ssh_pki_copy_cert_to_privkey(const ssh_key cert_key,
443454
ssh_key privkey)

0 commit comments

Comments
 (0)