0

I am having an issue with sftp.put in sharpssh. I am getting this error message:

Session.connect: System.Security.Cryptography.CryptographicException: Bad Data.
   at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)  
   at System.Security.Cryptography.Utils._ImportKey(SafeProvHandle hCSP, Int32 keyNumber, CspProviderFlags flags, Object cspObject, SafeKeyHandle& hKey)  
   at System.Security.Cryptography.DSACryptoServiceProvider.ImportParameters(DSAParameters parameters)  
   at Tamir.SharpSsh.jsch.jce.SignatureDSA.verify(Byte[] sig)  
   at Tamir.SharpSsh.jsch.DHG1.next(Buffer _buf)  
   at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)  `

Code:

Dim port = "22"
Dim host = "sftp.iceCream.com"
Dim Username = "softserve"
Dim Password = "chocolate"
Dim ftpFolder = "/toCREAM"
Dim fileName = "timbo.txt"


Dim sftp = New Sftp(host, Username, Password)
sftp.Connect(22)
sftp.Put(System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), fileName), ftpFolder) '+ "/" + fileName)

sftp.Close()
Pang
  • 9,564
  • 146
  • 81
  • 122

0 Answers0