(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
openssl_csr_export_to_file — CSR をファイルにエクスポートする
$csr
, string $output_filename
, bool $no_text
= true
): bool
openssl_csr_export_to_file() は、Certificate
Signing Request csr
を受け取り、
それを output_filename
という名前のファイルに
PEM フォーマットとして保存します。
バージョン | 説明 |
---|---|
8.0.0 |
csr は、
OpenSSLCertificateSigningRequest クラスのインスタンスを受け入れるようになりました。
これより前のバージョンでは、
OpenSSL X.509 CSR 型のリソースを受け入れていました。
|
例1 openssl_csr_export_to_file() の例
<?php
$subject = array(
"commonName" => "example.com",
);
$private_key = openssl_pkey_new(array(
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_RSA,
));
$csr = openssl_csr_new($subject, $private_key, array('digest_alg' => 'sha384') );
openssl_pkey_export_to_file($private_key, 'example-priv.key');
/ Along with the subject, the CSR contains the public key corresponding to the private key
openssl_csr_export_to_file($csr, 'example-csr.pem');
?>
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant