SSH authentication using X.509 certificates

Question:

I am unable to determine from the documentation if the Chilkat library supports SSH authentication using X.509 certificates.   In our application, we need to establish secure SSH connections to remote servers, and we prefer to use X.509 certificates for authentication instead of traditional username/password or key-based authentication methods.

Could you please clarify if the Chilkat SSH/SFTP API’s support X.509 certificate-based authentication for SSH connections?

If so, I would appreciate it if you could provide some guidance or link to sample code on how to implement this functionality using your library.

Answer:

The X.509v3 Certificates for SSH Authentication feature is something that gets configured on the server.  From the client perspective, you are simply doing public-key authentication in the same way.  For example, see these examples:

SFTP Authentication using X.509 Certificates

SSHAuthentication using X.509 Certificatesn

The private key is the certificate’s private key, which can be loaded from a .pfx/.p12, or various other sources such as smart cards, USB tokens, Windows certificate stores, or other file formats such as PEM, DER, etc.

On the SSH server, you would install the client’s certificate.  The method for doing so depends on the SSH server.  For OpenSSH, you can ask ChatGPT.  For example: