Create TScKey from Stream

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
Vandorr
Posts: 2
Joined: Tue 23 Sep 2008 19:24

Create TScKey from Stream

Post by Vandorr » Tue 23 Sep 2008 19:34

Hello!

I'd like to create a key from a StringStream. My Key is stored in the Private_key string variables

Code: Select all

    Key := TScKey.Create(nil);

    SStream:=TStringStream.Create(a);
    SStream.WriteString(private_key);

    Key.ImportFrom(SStream);
When it runs, it makes an exception: Key is Broken

What's wrong?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 24 Sep 2008 09:01

It is possible that you are trying to import a key which format is not supported by SecureBridge. Please give a detailed description of the private_key string.

Vandorr
Posts: 2
Joined: Tue 23 Sep 2008 19:24

Post by Vandorr » Wed 24 Sep 2008 17:07

My key is generated by the Demo SSHClient Program

The private_key string contains:

Code: Select all

SBP1AQE/b/nrAAACLAAAADdpZi1tb2Rue3NpZ257cnNhLXBrY3MxLXNoYTF9LGVu
Y3J5cHR7cnNhLXBrY3MxdjItb2FlcH19AAAABG5vbmUAAAHdAAAB2QAAAAYhAAAD
/0zFLqS8yTksG9Z62mhqD/Z8SBSWlEOKb1eIKM71e41aRVVPpbzIbuj0inI9SFoT
TqINfe1gpMJJnfHd4FnqwlkljeG0wtOz7zx9iMs8GOH63cske1rW6AItj+k6GBro
1uxgruMzevwwBEC6ph7oUDHGBTzPtubSZE1QxhSiADZhAAAEALT1W6jhkStVr1T9
AtGMSjK3PDCHggzq4eCcYDD5fqid7JI7vYYhl7dk/THZmEII8DTWqNQaqO6I9Exm
bEGpXGYaF1ER6uFKqCJicucWkJUynmI3CLUSU3pzaNTFfcm/r71OO/iK02G/rfkp
8OVIcCv6iRWzo0ACdAKmVKAxUafbAAACAMMOpBiansF+4569u/Ltb7VBufcuyLAe
UPpVApxQAwWnrO6WMQfnKc9CG89IXidKPquUk5zywSpTlblqLGwzrZUAAAIA5Os0
rDeB4gP4peApbZnN1+58FQILonCGidiiHUwcjb7noTrR+lHT95GT2MXVMnzjXcxS
K3ha6eOXixLMCh/d4QAAAgDKXazyemxlFNICYpV2vCBmyaveUZx1Ulx+KrF6r7bo
iIPtrg8E36kNyTp0o34W7Rxui9jDIFdNNkcmATXN6CU7CfBOK72xoPBtEEspFZO9
qwssd9M= 

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 29 Sep 2008 09:11

The ImportFrom method intend to import the key from different formats.
SecureBridge saves keys in its own format and you can't use it by importing the key, the only way to use them - on automatic saving and opening by TScStorage.

Post Reply