Re: wodFtpDLX.NET - Certificate - WeOnlyDo Discussion board

Re: wodFtpDLX.NET - Certificate (General questions)

by wodDamir, Wednesday, November 01, 2006, 21:31 (6378 days ago) @ macy

Hi Macy,

You can do something like this:
--------------------------------
Dim WithEvents ftp1 As WeOnlyDo.Client.FtpDLX
Dim keys As WODSSHKeyLib.Keys
Dim rsa As System.Security.Cryptography.RSACryptoServiceProvider
Dim cert As System.Security.Cryptography.X509Certificates.X509Certificate2

ftp1 = New WeOnlyDo.Client.FtpDLX
keys = New WODSSHKeyLib.Keys
cert = New System.Security.Cryptography.X509Certificates.X509Certificate2
rsa = New System.Security.Cryptography.RSACryptoServiceProvider

cert.Import( C:client.cer , your_password ,Security.Cryptography.X509Certificates.X509KeyStorageFlags.Exportable)
keys.Load( C:client.key , your_password ,Security.Cryptography.X509Certificates.X509KeyStorageFlags.Exportable)
rsa.FromXmlString(keys.ToXmlString(WODSSHKeyLib.SSHKeyTypes.RSAkey, True))
ftp1.Protocol = WeOnlyDo.Client.Protocols.FTPS
ftp1.Authentication = WeOnlyDo.Client.Authentications.Certificate
ftp1.Certificate = cert
ftp1.Hostname = your_hostname
ftp1.Login = your_username
ftp1.PrivateKey = rsa
ftp1.Blocking = True
ftp1.Connect()
--------------------------------

Hope this helps.

Regards,
Damba


Complete thread: