wodFtpDLX.NET - Certificate (wodFtpDLX / wodFtpDLX.NET)

by macy, (6767 days ago)

Hi,
I am using wodFtpDLX.NET component (evaluation version- VB 2005 on .NET framework 2.0) to connect to a FTP server. I am using FTP over SSL protocol. I have to use a client certificate which is password enabled to connect to the server. Can you post some code as to how to go about with the certificates?
The samples folder does not have any examples on certificates.
Thanks!

locked

Re: wodFtpDLX.NET - Certificate

by wodDamir @, (6761 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

locked

Re: wodFtpDLX.NET - Certificate

by Jasmine, (6761 days ago) @ wodDamir

I'd just like to point out about above sample - you DO NOT need wodKeys ActiveX all the time. it is only used to convert certificate from OpenSSL-style to XML style as used in NET framework. After you have it in XML, you can completely forget about wodKeys!

Kreso

locked

Re: wodFtpDLX.NET - Certificate

by Mike Cass @, (6598 days ago) @ Jasmine

I'd just like to point out about above sample - you DO NOT need wodKeys ActiveX all the time. it is only used to convert certificate from OpenSSL-style to XML style as used in NET framework. After you have it in XML, you can completely forget about wodKeys!

Kreso

How would you perform the above without reference to the wodKeys.dll (we've purchased WODFTPDLX.NET ). We're trying to connect to a WS_FTP server using ftp-authssl protocol.

locked

Re: wodFtpDLX.NET - Certificate

by Jasmine, (6598 days ago) @ woddrazen

Mike,

before you get toooo confused, wodFtpDLX.NET doesn't have wodKeyManager since its not needed for regular usage, and because it's build with NET1.1 framework.

In order to pass reference to your certificate, you should load your certificate using NET integrated X509Certificate class, and you should load your key using AsyncAlgorithm (if I'm correct about the name) class - do you have access to your certificates/key in such way?

Kreso

locked