Signature signature = Signature.getInstance("SHA1withRSA");
signature.initSign(kp.getPrivate());
final SSHPublicKey pkey = new SSHRSAPublicKey(
((RSAPublicKey)kp.getPublic()).getModulus(),
((RSAPublicKey)kp.getPublic()).getPublicExponent());
UserAuthFailureMessage uafm = new UserAuthFailureMessage();
when(transport.readMessage("publickey")).thenReturn(uafm);
when(transport.getSessionId()).thenReturn(new byte[20]);
// When
AuthenticationResult res = authMgr.authenticate("user", pkey, signature);
// Then