Florian, Heinz-Josef
2011-10-13 07:35:12 UTC
Hi All,
as a newbie to ssh i try to write a client (on ms windows) with public key authentication.
The function ssh_userauth_offer_pubkey(..) returns SSH_AUTH_SUCCESS, fine.
Now I understand I have to read the associated private key and then to use the function
ssh_userauth_pubkey().
My question: how to retrieve the private key?
I cannot find the declaration of the function ssh_pki_import_privkey_file() (mentioned in the docs). Instead I find
int ssh_userauth_privatekey_file(ssh_session session, const char *username, const char *filename, const char *passphrase), being declared in libssh.h
But no variable to hold the private key.
Surely I'm missing something. Can you help?
Regards,
Heinz-Josef Florian
Erwin Peters Systemtechnik GmbH
Abteilungsleiter / Entwicklung
Josef-Baumann-Straße 37
44805 Bochum
Tel.: (+49) 0234-9325-0
Fax : (+49) 0234-9325-190
e-mail: hj.florian-***@public.gmane.org
WWW: http://www.epsystem.de <http://www.epsystem.de>
Geschäftsführer:
Friedrich Abriß, Thomas Fink
Sitz der Gesellschaft: Bochum
Amtsgericht Bochum HRB Nr. 7667
as a newbie to ssh i try to write a client (on ms windows) with public key authentication.
The function ssh_userauth_offer_pubkey(..) returns SSH_AUTH_SUCCESS, fine.
Now I understand I have to read the associated private key and then to use the function
ssh_userauth_pubkey().
My question: how to retrieve the private key?
I cannot find the declaration of the function ssh_pki_import_privkey_file() (mentioned in the docs). Instead I find
int ssh_userauth_privatekey_file(ssh_session session, const char *username, const char *filename, const char *passphrase), being declared in libssh.h
But no variable to hold the private key.
Surely I'm missing something. Can you help?
Regards,
Heinz-Josef Florian
Erwin Peters Systemtechnik GmbH
Abteilungsleiter / Entwicklung
Josef-Baumann-Straße 37
44805 Bochum
Tel.: (+49) 0234-9325-0
Fax : (+49) 0234-9325-190
e-mail: hj.florian-***@public.gmane.org
WWW: http://www.epsystem.de <http://www.epsystem.de>
Geschäftsführer:
Friedrich Abriß, Thomas Fink
Sitz der Gesellschaft: Bochum
Amtsgericht Bochum HRB Nr. 7667