public boolean acceptsKey(String username, SshPublicKey key)
throws IOException {
if (authenticationState != AuthenticationProtocolState.COMPLETE) {
PublicKeyAuthenticationClient pk = new PublicKeyAuthenticationClient();
return pk.acceptsKey(authentication, username,
connection.getServiceName(), key);
} else {
throw new SshException("Authentication has been completed!");
}
}