note 112560 added to phar.using.intro

From: Date: Sat, 29 Jun 2013 23:46:23 +0000
Subject: note 112560 added to phar.using.intro
Groups: php.notes 
Request: Send a blank email to php-notes+get-195398@lists.php.net to get a copy of this message
The openssl example is completely wrong. The public key must be extracted from certificate and openssl_pkey_export() is for private key only. Working example: <?php $publicKey = openssl_get_publickey(file_get_contents('certificate.pem')); $details = openssl_pkey_get_details($publicKey); file_put_contents('my.phar.pubkey', $details['key']); ?> No need to say that the best and strongest encryption of my.phar/.phar/signature.bin is useless if the consumer does not check against a valid fingerprint or certificate of public key as anybody can open, read, recreate and sign a new archive with new key. Do you do? Think about it. ---- Server IP: 213.172.110.14 Probable Submitter: 84.112.102.108 ---- Manual Page -- http://php.net/manual/en/phar.using.intro.php Edit -- https://master.php.net/note/edit/112560 Del: integrated -- https://master.php.net/note/delete/112560/integrated Del: useless -- https://master.php.net/note/delete/112560/useless Del: bad code -- https://master.php.net/note/delete/112560/bad+code Del: spam -- https://master.php.net/note/delete/112560/spam Del: non-english -- https://master.php.net/note/delete/112560/non-english Del: in docs -- https://master.php.net/note/delete/112560/in+docs Del: other reasons-- https://master.php.net/note/delete/112560 Reject -- https://master.php.net/note/reject/112560 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195398) next »