title: How can I safely read a PKCS12 and pass it to an object in ruby?
body: <p>I'm currently using the google api client gem to communicate with the google apis. It uses PKCS12 to authenticate with these services and uses OpenSSL::PKCS12.new</p>
  
  <p><a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/openssl/rdoc/OpenSSL/PKCS12.html" rel="nofollow">http://www.ruby-doc.org/stdlib-2.0/libdoc/openssl/rdoc/OpenSSL/PKCS12.html</a></p>
  
  <p>However when I read the file with File.read and try to pass the string around I get String has a null byte error. How can I avoid this and make sure it is still DER encoded for the PKCS12 class?</p>