Re: Format of ssh private key - WeOnlyDo Discussion board

Re: Format of ssh private key (General questions)

by Marco, Tuesday, November 02, 2004, 15:17 (7117 days ago) @ wodSupport

Marco,

I'm trying to help you - but you have to help yourself too! Read your previous post - you do know how to generate key, and when you save it to a file everything works ok. Am I correct? If you load it from a file, it works ok, right?

So, your problem is that you're trying to put it into mysql. I wish I can help you with that - but I don't have your code, and I don't know how do you put it to mysql. wodKeys cannot write to mysql databases directly, naturally, so you have to do this. And you have to read it later on.

I have suggested you BASE64 encode private key before you write it, and then BASE64 decode after you read it from database, and then pass on to PrivateKeyData property. Have you tried that?

Did you, just for a test, try to
1. Generate key
2. Save to a file 'a.key'
3. store into database
and then
4. retrieve from database
5. save to a file 'b.key'
6. check if 'a.key' and 'b.key' are binary same?

If they mismatch then you have problems with storing keys to a database. If they match then you can skip storing to a file, and pass it to PrivateKeyData directly.

I'm really trying to help you out here with ideas - but I'm not sitting in front of your computer, you have to try these things out.

Best regards,
Kreso

Kreso,

i'm sorry for my bad english. Maybe I didn't explain very well.
I thank you for your time.
Now we have resolved everything.
The real problem was the function 'Open' under C/C++ .
We wasn't understanding because the key you sent us was different from our key generating by a linux command.
Now we generate the key with wodssh tool and use it (with the right Open function)very well.

Thank you very much by Marco and Damiano

see you later



Complete thread: