I'd like to use checkpassword-pam in a java application. It's a very simple executable that reads a username and password from fd 3 and then verifies it. The protocol is described here.
In a shell you'd use it like this:
# echo -e "username\0password\0timestamp\0" \
| checkpassword-pam -s SERVICE \
--debug --stdout -- /usr/bin/id 3<&0
How would I do this from a java application ? I'm sure it can't be done through standard Java, but perhaps accessing posix api via jna...