I'd like to implement support for ssh-rsa-cert-v01@openssh.com (and others) type certificate authentication and am looking for some guidance on the best way to implements this.
Looking at the code I propose to create a new PrivateKeyCertAuthenticationMethod class and associated CertificateHostAlgorithm to be used instead of the current PrivateKey/KeyHostAlgorithm classes. This would make the high level connection code something like
varkeyFile=newPrivateKeyFile(@"C:\temp\ssh_keys\id_rsa","xxxx");varcertFile=newPublicKeyCertFile(@"C:\temp\ssh_keys\id_rsa-cert.pub");varauthMethod=newPrivateKeyCertAuthenticationMethod("user",keyFile,certFile);varconnectionInfo=newConnectionInfo("192.168.1.1","user",authMethod);using(varclient=newSshClient(connectionInfo)){client.Connect();}What I'm wondering though, is this the best way to structure things or should I create only the CertificateHostAlgorithm and place some switching logic in the PrivateKeyFile class to swap out the HostAlgorithm?
Just looking for a bit of direction before I put through a huge PR that gets rejected... :-)
I'd like to implement support for ssh-rsa-cert-v01@openssh.com (and others) type certificate authentication and am looking for some guidance on the best way to implements this.
Looking at the code I propose to create a new PrivateKeyCertAuthenticationMethod class and associated CertificateHostAlgorithm to be used instead of the current PrivateKey/KeyHostAlgorithm classes. This would make the high level connection code something like
What I'm wondering though, is this the best way to structure things or should I create only the CertificateHostAlgorithm and place some switching logic in the PrivateKeyFile class to swap out the HostAlgorithm?
Just looking for a bit of direction before I put through a huge PR that gets rejected... :-)