KeyPair.Generate failure tests

Hi there,

I've written a test to prove the failure of KeyPair failing with a casting exception.

I'm going to go digging into it, but I'm not sure where the problem exists.

Thoughts?