EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Porting ImportCspBlob

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
Posted: 09/29/2014 09:41:11
by Mark Carrington (Standard support level)
Joined: 09/29/2014
Posts: 2

We currently have a number of keys stored from the results of DSACryptoServiceProvider.ExportCspBlob, which we used to import using DSACryptoServiceProvider.ImportCspBlob. These are used as host keys within an SSH server.

I'm now trying to port our server to use TElSSHServer. In order to provide continuity with the previous host keys I believe I need to import these keys into TElSSHKey objects. Is there a way of doing this?
Posted: 09/30/2014 03:12:17
by Ken Ivanov (EldoS Corp.)

Hi Mark,

Thank you for contacting us.

CryptoAPI-compatible private DSS keys can be decoded with an internal SBMSKeyBlob.Unit.ParseMSKeyBlob() method. The method takes a CryptoAPI-encoded DSS key on input and converts it to a 'standard' (FIPS) DSA private key. The method returns 0 (zero) if the conversion operation was successful.

On the next step, the produced FIPS key needs to be armoured with a PEM envelope. Another internal method, SBPEM.Unit.Encode(), can be used to perform the armouring. Pass a 'DSA PRIVATE KEY' line as a Header parameter.

The resulting armoured key can now be passed straight to the TElSSHKey.LoadPrivateKey() method.

Posted: 10/16/2014 09:08:17
by Mark Carrington (Standard support level)
Joined: 09/29/2014
Posts: 2

Fantastic, that worked perfectly, thanks!



Topic viewed 329 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!