PHP
downloads | documentation | faq | getting help | mailing lists | 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, 04 Jul 2008

view this page in

openssl_pkey_export

(PHP 4 >= 4.2.0, PHP 5)

openssl_pkey_export — Liefert eine exportierbare Representation eines Schlüssels in einem String

Beschreibung

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

openssl_pkey_export() exportiert key als eine PEM kodierte Zeichenkette und speichert diese in out (welcher per Referenz übergeben wird).

Hinweis: Die ordnungsgemäße Ausführung dieser Funktion setzt die Installation einer gültigen openssl.cnf Datei voraus. Mehr Information hierzu finden sie im Installationsabschnitt.

Parameter-Liste

key

out

passphrase

Der Schlüssel wird optional von einer passphrase geschützt.

configargs

configargs können Sie benutzen, um den Export feiner abzustimmen. Sie können damit Optionen für die openssl Konfigurationsdatei bestimmen und/oder überschreiben. Für mehr Informationen über configargs schauen Sie bitte bei der Dokumentation zu openssl_csr_new() nach.

Rückgabewerte

Gibt bei Erfolg TRUE zurück, im Fehlerfall FALSE.



add a note add a note User Contributed Notes
openssl_pkey_export
07-May-2007 12: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 11: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, 04 Jul 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites