wodFtpDLX.NET - Certificate - WeOnlyDo Discussion board

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

by macy, Thursday, October 26, 2006, 17:11 (6395 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!

Re: wodFtpDLX.NET - Certificate

by wodDamir, Wednesday, November 01, 2006, 21:31 (6389 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

Re: wodFtpDLX.NET - Certificate

by wodSupport, Wednesday, November 01, 2006, 23:04 (6389 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

Re: wodFtpDLX.NET - Certificate

by Mike Cass, Friday, April 13, 2007, 16:07 (6226 days ago) @ wodSupport

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.

Re: wodFtpDLX.NET - Certificate

by woddrazen, Friday, April 13, 2007, 16:18 (6226 days ago) @ Mike Cass

Hi Mike,


wodKeyManager component is part of our wodSFTP.NET and wodSSH.NET components.

It would be best that you install wodSFTP.NET or wodSSH.NET and after that use wodKeyManger in your application.

You can download wodSFTP.NET here:
http://www.weonlydo.com/Samples/wodSFTP.NET.msi

and wodSSH.NET here:
http://www.weonlydo.com/Samples/wodSSH.NET.msi

Let us know how it goes.


Drazen

Re: wodFtpDLX.NET - Certificate

by wodSupport, Friday, April 13, 2007, 20:58 (6226 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