Load Key from DB (General questions)

by Dk @, (7008 days ago)

Hi,

I am able to connect and upload using login/private key combination provided the key is loaded from a file.

But our requirement is to store the private key in database (MS SQL) and then authenticate the login using that information.
Any ideas on storing and loading the key from db ?

Thanks
Dk.

locked

Re: Load Key from DB

by wodDrazen @, (7008 days ago) @ Dk

Hi,

Load method will accept raw key data (one that starts with ---- BEGIN RSA PRIVATE KEY----) to be passed as argument, instead of filename, so you can basically store raw key data to a database, then retrieve it later on and pass to Load method.

Hope I helped.

Regards,
Drazen

locked

Re: Load Key from DB

by Dk @, (7005 days ago) @ wodDrazen

Hi,

The key was successfully saved in the the db. When i tried to load it using the following code snippet it threw an exception: Failed to open key file

KeyManager keyMgr = new WeOnlyDo.Security.Cryptography.KeyManager();
SSHKeyTypes keyType = keyMgr.Load(System.Text.Encoding.Default.GetString(this.PrivateKey));

this.Privatekey has the exact key information as in the key file.

Please help

Thanks
Dk.

locked

Re: Load Key from DB

by Jasmine, (7005 days ago) @ Dk

My mistake.

I thought you're using ActiveX. wodKeyManager.NET currently doesn't have option to use full raw data with Load method.

But we can add that - give us a day or so.

Kreso

locked

Re: Load Key from DB

by Jasmine, (7005 days ago) @ Jasmine

DK,

I double checked, wodKeyManager.NET will already Load key from string raw data. This code works correctly for me: [code]WeOnlyDo.Security.Cryptography.KeyManager km = new WeOnlyDo.Security.Cryptography.KeyManager();
string a;
a = -----BEGIN RSA PRIVATE KEY-----\r\nMIICWQIBAAKBgQD........Qtz1ekkOeOic=\r\n-----END RSA PRIVATE KEY----- ;

km.Load(a);
Console.WriteLine(km.PublicKeyOpenSSH(WeOnlyDo.Security.Cryptography.SSHKeyTypes.RSAKey));
[/code]

Kreso

locked

Re: Load Key from DB

by Dk @, (7005 days ago) @ Jasmine

Hi,

The version on the keymanager dll that i am using is 1.0.0.2, does this have the overloaded load method that can work with the key itself rather than the file name ? I doubt. Since it throws an exception Failed to open key file .

Do i have to upgrade ? If yes please send me the information.

Thanks
Dk.

locked

Re: Load Key from DB

by Dk @, (7004 days ago) @ Jasmine

Hi

The update page requires an email id and its that of a person who left the company, is there any other way to get an update ?

Thanks
Dk.

locked

Re: Load Key from DB

by Jasmine, (7004 days ago) @ Dk

Yes it is, please send email to sales@weonlydo.com describing the situation, send us old email and we will update your records in our database.

Kreso

locked