signature.initSign(kp.getPrivate());
final PublicKey publickey = kp.getPublic();
final SSHPublicKey pkey = new SSHRSAPublicKey(
((RSAPublicKey)kp.getPublic()).getModulus(),
((RSAPublicKey)kp.getPublic()).getPublicExponent());
UserAuthPublicKeyOk uapkok = new UserAuthPublicKeyOk();
uapkok.setAlgorithm("ssh-rsa");
uapkok.setPubkey(pkey.encode());
UserAuthSuccessMessage uasm = new UserAuthSuccessMessage();
when(transport.readMessage("publickey")).thenReturn(uapkok).thenReturn(uasm);
when(transport.getSessionId()).thenReturn(new byte[20]);
// When
AuthenticationResult res = authMgr.authenticate("user", pkey, signature);