Re: How to load a string in a certificate ? (General questions)
Here, what I tryed :
Public Function TexteToBase64(ByVal Texte As String) As String
Try
Dim texteBytes As Byte() = Encoding.ASCII.GetBytes(Texte)
If texteBytes.Length = 0 Then
Return
Else
Return Convert.ToBase64String(texteBytes)
End If
Catch ex As Exception
Return
End Try
End Function
ppk = -----BEGIN RSA PRIVATE KEY----- & vbLf
ppk = ppk & key & vblf
ppk = ppk & -----END RSA PRIVATE KEY----- & vbLf
ftp1 = New wodFtpDLXComLib.wodFtpDLXCom
ftp1.Certificate = TexteToBase64(ppk)
And I got this :
ystem.InvalidCastException: Unable to cast object of type 'System.String' to type 'wodFtpDLXComLib.ICertificate'.
Complete thread:
- How to load a string in a certificate ? - Bertrand, 2007-07-25, 18:05
- Re: How to load a string in a certificate ? - wodSupport, 2007-07-25, 18:16
- Re: How to load a string in a certificate ? - Bertrand, 2007-07-25, 18:44
- Re: How to load a string in a certificate ? - woddrazen, 2007-07-25, 19:28
- Re: How to load a string in a certificate ? - Bertrand, 2007-07-25, 23:41
- Re: How to load a string in a certificate ? - woddrazen, 2007-07-25, 19:28
- Re: How to load a string in a certificate ? - Bertrand, 2007-07-25, 18:44
- Re: How to load a string in a certificate ? - wodSupport, 2007-07-25, 18:16