Login  
Search All Forums
Dart Home | PowerTCP SFTP & SSH for .NET | Custom Development Reply | PowerTCP SFTP & SSH for .NET Topics | Forums   
AuthorForum: PowerTCP SFTP & SSH for .NET
Topic: Hostkey validation
moeck

From: Cologne, Germany
Posts: 10
Member Since: 05/29/18
posted June 13, 2018 6:46 AM

Hi,
to execute validation I set AcceptAllHostKeys to false and added a handler method to the HostKeyEventHandler.
Now I get the hostkey by the HostKeyEventArgs as a byte array. The key to compare has the format "ssh-rsa 2048 df+r....".
How can I compare those Keys? I tried several conversions but got no match at all.
Jason Farrar (Admin)

From: Oneida, NY USA
Posts: 223
Member Since: 07/24/07

Extra Support Options
Custom Application Development

posted June 14, 2018 11:30 AM

The answer to this depends on what format your key has been stored in, unfortunately I'm not sure which format starts with ssh-rsa 2048.

For example, public keys generated by OpenSsh's ssh-keygen utility have the format of:
ssh-rsa base64-encoded-key key-originator

To compare, one would need to decode the base 64 encoded portion and do a byte comparison against e.HostKey.

If you're absolutely sure that your key file only contains the public key for your server you can send it in to support@dart.com and we will be happy to help you resolve the issue.

Reply | PowerTCP SFTP & SSH for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX