title: Get standard, printable public-key string for ECDSA
body: <p>I'm looking to be able to generate the same kind of public-key string that you'd get from "ssh-keygen -t ecdsa". I have an EC_KEY.</p>
  
  <p>I tried using:</p>
  
  <pre><code>PEM_write_bio_EC_PUBKEY(bio_out, ecdsa);
  </code></pre>
  
  <p>...But I get a string that's entirely too large.</p>
  
  <p>I tried this:</p>
  
  <pre><code>ec_group = EC_KEY_get0_group(pubkey-&gt;ecdsa);
  ec_point = EC_KEY_get0_public_key(pubkey-&gt;ecdsa);
  
  encoded = EC_POINT_point2hex(
              ec_group,
              ec_point,
              POINT_CONVERSION_UNCOMPRESSED,
              NULL);
  </code></pre>
  
  <p>...But obviously I want something that's base64-encoded.</p>
  
  <p>Can anyone give me direction, here?</p>