title: Sanity check SSH public key?
body: <p>I have asked users for their public "id_rsa.pub" ssh key, that I then place in "/home/theiraccount/.ssh/authorized_keys", so they can login to the server by SSH.  I'd like to automate this process.</p>
  
  <p>Is there anyway to sanity check the string they give me (programmatically or otherwise)?  I want to verify that sshd can read the text and that it actually looks like a valid public key (and hasn't been corrupted)?</p>
  
  <p>Put another way, what is the format of the <code>id_rsa.pub</code> file?  If someone enters it in a field what can I write in the form handler script to verify that it is complete and correct?</p>