Well the issue is that this callback only really works with libssh2 because if you look at the callback signature:
int name(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, \
           const unsigned char *data, size_t data_len, void **abstract)
It passes a LIBSSH2_SESSION pointer to the callback method.