PrivateKey file

Jan 18, 2011 at 10:13 PM

What format does the private key file need to be in?    Is it something like:

-----BEGIN RSA KEY---------sdfr3537dfglknkjfdsufidfs .......

....as2345dfsdfr235treff09iuhr2r29fg2rutu-----END RSA KEY-----

This apparently is "OpenSSH" format.   Any guidance on the format of the file or

instructions to generate from putty would be greatly appreciated.     Thanks!

Coordinator
Jan 18, 2011 at 10:19 PM

It should look something like this:

-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA8ZsD8jgH7ySXnd4dprEFFkJ+zs1ne81E8febjR8hekiKrc+D
9GjeEykchy0PsrsBrf2F8J3GtLNISVerkl+EnVh1E0pi9Vllc1vcpQHvBeNPG/jl
9Dnum/DcaaMKLot+ARXjBuMX/xJVfnlgkvfpBvoq4QzQ6E27rOMbcPlvrN7KeYba
orsTpDMUraHX5u99P1evvw7sOuNl3lc9YpIgmjHT6dWUGTqBx9T2SEKXBRVk2NNb
d2UctQkr5BJn1gGehA+1KYS30FMiCSN8F8ZOlpYj1+K6xzs0srq1z30LailIyy7Q
mYp739BJlOF3cVywdcFXGre35H2cJylcNV2e+QIBIwKCAQAbnK/+bM207j02nQqz
9vlEX17zECkVdouJXiBn5kz4CEpdAcXwC/wfcmmpDHbSmQeBmVEi0DP3ZPJRhlzA
RW493jlECIBWjd+1aZWPM2vGKJtTp2q802u6DOX9cbgFUcVB899ugFqDjREVxLqU
dBqhtjDJQ0sTPBVy2CBkrsrvLy7AZd4LlaqxpdTdpkD/auUxg4zdThHT/XeQ0V0G
3BS5vGehfqgkDOQpQSm7HexM+9GDJnnzMdNXjmWBPxZU49QAlxujZeZ1M2IgKwMq
eNkWAOnZJidfsfwYluSCi8OHPN2i1s/b7pgn6ffb50S/k2mmhTHxNChDdGTlW91G
6CFLAoGBAPlGA4qzZCG4SLBQicGhhXZlwaKKfTvWNi4xNPZeoJezC0G+yZZT7IIV
zCj83t3dteaRRw15e+7NuIXZx3zl2hANfEpBZwnS4sOekvbS9/S7cEVzOEk53jRU
TOtHRsvNxS2xK3RywqoaqzcPaK2Df917yzbqvEajMRudRPrsTvYdAoGBAPggB/kJ
+VxZf13JqV2KgrFoVvykJpRlw2F5+lkH69ON9gdl976J3TNJDqAmHeWFxBUL+6Lt
9TSpMq3fYueJXg9xaTkSYg177sPRGCmRLO5aneA4nJkIB6KHRXsR71C9D4fJK8Fi
YB5n5dnBUTBhkvaI6KsdcxDzEg2zAJEcn4WNAoGBAOsHf66pI+VHWnpakINdxvqa
dL3TCFz9K8UnFK3A7y/x9Kuz4qOuNsPLaLjua7s+wXL+ASn2MwW6pqoWekKPkxZz
HWqVb8dvEFIKipDyzIepadsU3UxbIfbTI/PG3FnCAw3S7nUbvtrl8eN07arpsxKn
63zr81iLPO4mkX7ezhs/AoGADi23UA8y0hO+Ip3PKeqoYei0g3cYJbysFDLbGwfE
VTtP4ypl7aF6WrO2sWFDiXVbqW5mJpFBNjWN3gzD0rdkdek5NnYUO0jpEoD6EQD7
QNH6ZJWFSpK+m5Kzg2AcTcGpHbO5W4H23SqCKbNGd8sPtlD3Wj1XCEhnbn9B3GgJ
HZMCgYEAjn9BH4fcobMaM15AV0s6sCEyr/vzn3QBfoIBqqqlipMqOtPDv8oyvGO4
5tSpMrTKf4e3YAMPA4TXRAiVLjeRYlhdj3He0LkAuZZabrHeRmWqjDruMWd1TcKZ
3o8DLgYbSH7eGXUJ+euM4spKr5OLkBEkmH7Of6Qxss2njvjVNTE=
-----END RSA PRIVATE KEY-----

or if its encrypted should look likes this:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,B3475536EDD1B442

Xa6Y7FYTfz19CMzPcVbCpBHEh8x3tnA9PutKEDNMwKbR+NVUvBx5fN1QjrLpltCr
uX7yD3vLCeyihg4oaK3nTBZBcsB/1TZx+MlLgpvMfV1JKmbKCmebBZ3lUpsypHlG
FpCY41miFwdHmBe6tuwL9XA3vz26eJwSgJGMkVN9EBvNbiOHinEPhSW0whzBfbv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RLRKJzzuQZOuwd95whKFXroFsdeaHxO
hS4PqlLbuSMLiSIaPSZM6Huc4kb5lqCaxg/SBlXTCX17Z/8TFoqV/wCJz17XnkH6
9WtKAC2TwKxiLZ2Qzwr2XV48lASugIOZkSW2qxM9ui+b1T9ICFKRGLn/UB//pOiG
270hNJDLB/BKRExjS+RXeOpdAIJB5XsAEp8h56ub9emhhf9tCEXOn7PN7HbMCnQh
7k8EpAG0h5StLUhY1HHvynVz2/qyMvZa/bIaaudL2565Z6nDU+iBxed7O1qrbRAH
Vakr7Sa3K5niCyH5kxdyO1t29l1ksBqpDUrj+vViFuLkd3XIiui8IA==
-----END RSA PRIVATE KEY-----

Putty uses some its own specific format, but have tool to import key from this format, examples above, into its own format.

 

If you using the key with putty and it doesnt work with the library please let me know what type of key is that, or how you created it, since I know I didnt implement all possible keys but only DSA and RSA.

Tanks,

Oleg

Jan 18, 2011 at 10:33 PM

Thanks very much for the info Oleg.  I tested with the first (unencrypted) format and it works well.     Also is the ssh.NET library thread safe (run multiple threads with one

client instance per thread).

Also tried to open the .chm documentation file but for every help item in the index, the help application content frame shows "The page cannot be displayed" the page you are looking for is currently unavailable.... 

Is the documentation available in some other format?

This library is awesome!    Thanks

Coordinator
Jan 19, 2011 at 4:35 AM

Hi,

 

Yes, this library is full thread safe and  built it in multhreading in mind, so if you have a scenario where it should work and it doesn't, please let me know.

 

As far as help file, all help file that you download from the internet need to be unblocked, thats why you dont see anything, so check properties of the CHM file, once you download it and then "Unblock" it.

Unfortunately I don't have documentation in any other form, not yet anyway :(

Thanks,

Oleg

Sep 22, 2011 at 12:33 PM
Edited Sep 22, 2011 at 12:47 PM

I had the same issue with the help file. I unblocked it, and was still getting the same error. So I had to move it to a local drive (it cannot be used on a network drive).

As for the SSH PrivateKey file, I'm not able to use mine. I get a "Invalid private key file." exception. 

The key is working great with the SharpSSH library, as well as with linux ssh client.

Info about the key :

Type of key : SSH-2 RSA
Bits : 1024

Any clue?

Thanks, 

JeeZ

Sep 22, 2011 at 1:39 PM
jeez wrote:

I had the same issue with the help file. I unblocked it, and was still getting the same error. So I had to move it to a local drive (it cannot be used on a network drive).

As for the SSH PrivateKey file, I'm not able to use mine. I get a "Invalid private key file." exception. 

The key is working great with the SharpSSH library, as well as with linux ssh client.

Info about the key :

Type of key : SSH-2 RSA
Bits : 1024

Any clue?

Thanks, 

JeeZ

Ok, I've looked into the code, and it seems it doesn't work because my key was not encrypted, and so the regex was failing. I've added a passphase to my key and now it works.