openssl_csr_export

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

openssl_csr_export — CSR을 문자열로 내보냅니다.


설명

openssl_csr_export(OpenSSLCertificateSigningRequest|string $csr, OpenSSLAsymmetricKey &$output, bool $no_text = true): bool

openssl_csr_export()csr이 나타내는 인증서 서명 요청을 받아 PEM 형식으로 output에 저장합니다. 이 요청은 참조로 전달됩니다.


매개변수

csr
유효한 값 목록은 CSR 매개변수를 참조하십시오.
output
성공하면 이 문자열에는 PEM으로 인코딩된 CSR이 포함됩니다.
no_text
선택적 매개변수 notext는 출력의 자세한 정도에 영향을 줍니다. false인 경우 사람이 읽을 수 있는 추가 정보가 출력에 포함됩니다. notext의 기본값은 true입니다.

반환 값

성공하면 true를, 실패하면 false를 반환합니다.


변경 로그

버전 설명
8.0.0 csr은 이제 OpenSSLCertificateSigningRequest 인스턴스를 허용합니다. 이전에는 OpenSSL X.509 CSR 유형의 리소스가 허용되었습니다.

Examples

예제 #1 openssl_csr_export() 예제

                  
<?php
$subject = array(
    "commonName" => "example.com",
);
$private_key = openssl_pkey_new(array(
    "private_key_bits" => 2048,
    "private_key_type" => OPENSSL_KEYTYPE_RSA,
));
$configargs = array(
    'digest_alg' => 'sha256WithRSAEncryption'
);
$csr = openssl_csr_new($subject, $private_key, $configargs);
openssl_csr_export($csr, $csr_string);
echo $csr_string;
?>
                  
                

기타