Added support for configuring public key authentication.

Closes #506.