Re: How to load a string in a certificate ? - WeOnlyDo Discussion board

Re: How to load a string in a certificate ? (General questions)

by woddrazen, Wednesday, July 25, 2007, 19:28 (6331 days ago) @ Bertrand

Hi Bertrand,


Please try something like this using your private key:
[code]
Dim ftp1 As wodFtpDLXComLib.wodFtpDLXCom
ftp1 = New wodFtpDLXComLib.wodFtpDLXCom
Dim cert As WODCERTMNGLib.Certificate
cert = New WODCERTMNGLib.Certificate
Dim KeyData As String

ftp1.Certificate = cert

KeyData = -----BEGIN DSA PRIVATE KEY----- & vbCrLf & _
MIIBugIBAAKBgQCs/Q3P0pu1Ot8LOCTnJ2MeZTRyrjbCaszKiJb3239IABs+svVN & vbCrLf & _
lLNHRR7S+AHtY7CNh/lyhC8tXkX8pK9npjhZh6kesPILCkc5LtqeDaCnC4wchtDO & vbCrLf & _
owmOFEJclpFnyzbJCDnjg+FB5fMDdiNXqJ4bcXIFFLPo3aNrrnulrjJSGwIVAOpg & vbCrLf & _
x+r/mibxlXbPPKUWl7VFosKLAoGAeeXbTM4CtKYqI6AB6nXR07uOumkzyiE5Wb4p & vbCrLf & _
Jw4GxKnTNv8Mc4Xf+rdkbcwXhO/TR2vDj/sXMt9KIi/F6g8hHwrXCBXrPVZwGai0 & vbCrLf & _
fSAdrhU1uxYAug2fbsQ4BsG9pLpYvHUQ4nIINCcl7vfR4ij41/cYtC1nwUlbXHnJ & vbCrLf & _
cNHSh9wCgYBIYciU8r7gMp9pJrBz/zsEcI9CrHWkVB74oGX4hvupXzyj37mM6DpN & vbCrLf & _
py3Xrgl+2OOy0e1uZHHrIeSgV3mIkVbRPPIy/VjZzTm1hs1vtY5BiwHQHNcxRgRk & vbCrLf & _
agrJWOZgHh0haxG7JOxUYSUVsUOeMR4Cgo26B/Su2HK0NMc21Ji0kwIUDr7nYvGg & vbCrLf & _
qKNyluiUbkrQsUYqKso= & vbCrLf & _
-----END DSA PRIVATE KEY-----

cert.LoadKey(KeyData)
Debug.Print(cert.PublicKeyOpenSSH)
[/code]
Let us know how it goes.


Regards,
Drazen


Complete thread: