mono / ngit

Automated jgit port to c#
261 stars 152 forks source link

Nsch - generating RSA key fails with casting exception #54

Open dougrathbone opened 11 years ago

dougrathbone commented 11 years ago

if you do:

var keyPair = NSch.KeyPair.GenKeyPair(jsch, NSch.KeyPair.RSA, 1024);

you get a casting exception:

Unable to cast object of type 'Sharpen.RSAPrivateKey' to type 'Sharpen.RSAPrivateCrtKey'.

I'm going to try and clone and fix the bug, but I'm just wanting to check i'm calling it correctly?

ArsenShnurkov commented 9 years ago

Now i understand you both better. He https://github.com/mono/ngit/pull/55#issuecomment-17035968 is still right in his position.

I'm just wanting to check i'm calling it correctly?

I think yes. No conditions is given in docs: http://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/KeyPair.html so you should be able to just create a keypair this way.

So this should be labelled as bug, debugged and discussed.

I hasn't applied your patch yet. Just built NGit on mono-4 (on gentoo family).