Note that there are some explanatory texts on larger screens.

plurals
  1. POCRX_ZREO_SIGNTURE_LENGTH failure in .crx file
    primarykey
    data
    text
    <p>I have found this post <a href="https://stackoverflow.com/questions/5013263/create-google-chrome-crx-file-with-php">Create Google Chrome Crx file with PHP</a> to create a .crx file vith my ZIP archive. but when I try to run it I got a length of $signtrue = 0 and I didn't figure out why...my .pem file in found and valid, as well my .pub key file but it still return to me a zero length in the signture...</p> <pre><code>$fp = fopen("/public_html/apps/chrome/nsii.pem", "r"); $priv_key = fread($fp, filesize($fp)); fclose($fp); $pkeyid = openssl_get_privatekey($priv_key); openssl_sign(file_get_contents("$name.zip"), $signature, $pkeyid, 'sha1'); openssl_free_key($pk); # decode the public key $key = base64_decode(file_get_contents('extension_public_key.pub')); $fh = fopen("$name.crx", 'wb'); fwrite($fh, 'Cr24'); // extension file magic number fwrite($fh, pack('V', 2)); // crx format version fwrite($fh, pack('V', strlen($key))); // public key length fwrite($fh, pack('V', strlen($signature))); // signature length fwrite($fh, $key); // public key fwrite($fh, $signature); // signature fwrite($fh, file_get_contents("$name.zip")); // package contents, zipped fclose($fh); </code></pre> <p><strong>UPDATE:</strong></p> <p>The orignial code is as following:</p> <pre><code>&lt;?php # make a SHA1 signature using our private key $pk = openssl_pkey_get_private(file_get_contents('/public_html/apps/chrome/nsii.pem')); openssl_sign(file_get_contents('/public_html/apps/chrome/extGoogle.zip'), $signature, $pk, 'sha1'); openssl_free_key($pk); # decode the public key $key = base64_decode(file_get_contents('/public_html/apps/chrome/extension_public_key.pub')); # .crx package format: # # magic number char(4) # crx format ver byte(4) # pub key lenth byte(4) # signature length byte(4) # public key string # signature string # package contents, zipped string # # see http://code.google.com/chrome/extensions/crx.html # $fh = fopen('extension.crx', 'wb'); fwrite($fh, 'Cr24'); // extension file magic number fwrite($fh, pack('V', 2)); // crx format version fwrite($fh, pack('V', strlen($key))); // public key length fwrite($fh, pack('V', strlen($signature))); // signature length fwrite($fh, $key); // public key fwrite($fh, $signature); // signature fwrite($fh, file_get_contents('/public_html/apps/chrome/extGoogle.zip')); // package contents, zipped fclose($fh); </code></pre> <p>Seems is not work as well...the question is why?... All works fine if I using CLI to compile it...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload