Print public key on init.
This commit also fixes an issue with data length check in key/data conversion methods.