Jump to content

sookyboo

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Posts posted by sookyboo

  1. I have a .cer file (generated from a jsp server I think).

     

    I need to extract it's public key and use the public key to encrypt a value...

     

    I get these errors:

    Warning: openssl_x509_read() [function.openssl-x509-read]: supplied parameter cannot be coerced into an X509 certificate! in /public_html/test/cert.php on line 26

     

    Warning: openssl_x509_free() expects parameter 1 to be resource, string given in /public_html/test/cert.php on line 34

     

        $fp = fopen("/home/x.cer", "r");

        $cert = fread($fp, 8192);

     

        fclose($fp);

    openssl_x509_read( $cert);

    $data = openssl_x509_parse($cert);

     

    print_r($data);

     

    openssl_x509_free( $cert );

     

     

    Any ideas what is wrong...

    Starting to get frustrated...

    Thanks in advance

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.