title: how to store public key as c array
body: <p>I've been looking for an answer for this for a while so i though i might aswell post what I've found.</p>
  
  <p>I'm using openssl to sign and verify license using private key to sign and public key to verify.</p>
  
  <p>since I'm sending the public key to the client for verification, I can't give it to him and ask for path to key, because he can change the public key and encrypt the message using his own private/public keys.</p>
  
  <p>the solution: store the public key inside the C program as an array.</p>
  
  <p>now i need to change my code of reading the public key from:</p>
  
  <pre><code>EVP_PKEY   *public_key = NULL;
  
  public_key_fd = fopen( public_key_path, "r" );
  if ( !public_key_fd )
       // something went wrong
  PEM_read_PUBKEY( public_key_fd, &amp;public_key, NULL, NULL );
  fclose( public_key_path );
  </code></pre>
  
  <p>to something that uses a string instead of a file.</p>