title: How to convert a PublicKey to JSON in Java?
body: <p>I want to send a client's public key (java.security.publickey) in JSON format to my server. I'm using Google's Gson library to convert in between, however, I'm getting a runtime exception which tells me that Key is an interface and I need some kind of adapter to parse it. Have anyone encountered this problem? Any solution is welcome, I just need to transfer the key via HTTP.</p>
  
  <p>Thank you!</p>