PHP
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

openssl_pkey_free> <openssl_pkey_export_to_file
Last updated: Fri, 30 Jan 2009

view this page in

openssl_pkey_export

(PHP 4 >= 4.2.0, PHP 5)

openssl_pkey_exportエクスポート可能な形式で、キーを文字列に取得する

説明

bool openssl_pkey_export ( mixed $key , string &$out [, string $passphrase [, array $configargs ]] )

openssl_pkey_export() は、 key を PEM エンコードした文字列として取得し、 out (参照渡し)に格納します。

注意: この関数を正しく動作させるには、正しい形式の openssl.cnf をインストールしておく必要があります。 詳細な情報は、インストールについてのセクション を参照ください。

パラメータ

key

out

passphrase

オプションで passphrase を使用してキーを保護することが可能です。

configargs

configargs により openssl 設定ファイルの設定を 追加したり上書きしたりすることで、エクスポート処理の詳細設定が可能です。 configargs についての詳細な情報は openssl_csr_new() を参照ください。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。



add a note add a note User Contributed Notes
openssl_pkey_export
07-May-2007 10:31
you can get public key using openssl_pkey_get_details(resource $key ) function:

<?php

$pub_key
= openssl_pkey_get_public(file_get_contents('./cert.crt'));
$keyData = openssl_pkey_get_details($pub_key);
fule_put_contents('./key.pub', $keyData['key']);

?>
robbat2 at gentoo dot org
09-Aug-2004 09:47
Warning, this function is NOT capable of exporting PEM-encoded public keys. It can only export private keys.

openssl_pkey_free> <openssl_pkey_export_to_file
Last updated: Fri, 30 Jan 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites