Page 1 of 1
Create TScKey from Stream
Posted: Tue 23 Sep 2008 19:34
by Vandorr
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?
Posted: Wed 24 Sep 2008 09:01
by Dimon
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.
Posted: Wed 24 Sep 2008 17:07
by Vandorr
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=
Posted: Mon 29 Sep 2008 09:11
by Dimon
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.