wodSSHD Keys - WeOnlyDo Discussion board

wodSSHD Keys (General questions)

by David Lucas, Tuesday, May 09, 2006, 12:27 (6773 days ago)

I'm aware that you can save and load keys to file in PEM format using wodSSHD's key pair object, but is there any way to access the keys in PEM format without having to write them out to disk first?

The Private Key properties seem to return the data in a different format to PEM.

We want to be able to store a generated key in our database in PEM format - so I'm wondering if it's possible to do this without having to save the key to a file, read that file, write its contents to the database and delete the file.

Re: wodSSHD Keys

by wodSupport, Tuesday, May 09, 2006, 12:28 (6773 days ago) @ David Lucas

David,

if Load method would accept raw PEM data instead of filename, would that solve your problems? THat way you could read it from database as string, and pass directly to Load method.

Kreso

Re: wodSSHD Keys

by David Lucas, Tuesday, May 09, 2006, 13:15 (6773 days ago) @ wodSupport

Sadly not, because what we're trying to do is generate the key with the WeOnlyDo component, then store it in our database (in PEM format).

I think the load method already accepts raw PEM doesn't it? That's the way we currently load the key when creating our WeOnlyDo SSH server objects - we read it from the database into a string value and then load that into the WeOnlyDo object.

Re: wodSSHD Keys

by wodSupport, Tuesday, May 09, 2006, 13:17 (6773 days ago) @ David Lucas

David,

then I didn't understand the question. What does it mean 'access the keys' exactly?

You know, you can read/write to PrivateKey property (even it's not PEM), but I'm affraid it will not work on non-english windows.

Kreso

Re: wodSSHD Keys

by David Lucas, Tuesday, May 09, 2006, 13:36 (6773 days ago) @ wodSupport

By access the keys in PEM format I essentially meant read/write them in PEM format, yes.

So it looks like the answer to my question is no , and in order to read the generated key in PEM format I'll have to write the key to a temporary file (using the Save() method), then read that file (using fopen or something), store its contents in my database and delete the file.

Thanks for confirming my suspicion.