Re: WeOnlyDo.Security.Cryptography.KeyManager.Load - WeOnlyDo Discussion board

Re: WeOnlyDo.Security.Cryptography.KeyManager.Load (General questions)

by Tom, Monday, December 14, 2009, 17:10 (5239 days ago) @ woddrazen

Hi Drazen,

Thanks a lot, it works! :-)

My .Net Example with FtpDLX.NET:
================================
WeOnlyDo.Client.FtpDLX ftp1 = new WeOnlyDo.Client.FtpDLX();

ftp1.Hostname = textBox1.Text;
ftp1.Login = textBox2.Text;
ftp1.Password = textBox3.Text;
progressBar1.Minimum = 0;
ftp1.Protocol = WeOnlyDo.Client.Protocols.SFTP;
ftp1.Authentication = WeOnlyDo.Client.Authentications.PublicKey;
WeOnlyDo.Security.Cryptography.KeyManager keyManager = new WeOnlyDo.Security.Cryptography.KeyManager();
keyManager.Load(@ -----BEGIN RSA PRIVATE KEY-----
XXXXX... etc. ...XXXX
-----END RSA PRIVATE KEY----- , textBox3.Text);
ftp1.PrivateKey = keyManager.ToXmlString(WeOnlyDo.Security.Cryptography.SSHKeyTypes.RSAKey, true);
ftp1.Blocking = true;
ftp1.Port = System.Convert.ToInt32(textBox4.Text);
ftp1.Connect();

Regards,

Tom

H Tom,


Actually you can load private key from a string value in Load Method.

Here is example:
http://www.weonlydo.com/index.asp?kb=1&View=entry&EntryID=73

Example is for our wodKeys component but principle should be same for wodKeyManager.NET.

In example please look as Key.Load Method line how private key should be loaded in.

Let us know how it goes.


Regards,
Drazen

[:smile:][:smile:][:smile:]


Complete thread: