Rewrite sshkey security plugin

Updated unit tests