openssl_csr_get_public_key

PHP 5 >= 5.2.0, PHP 7, PHP 8
openssl_csr_get_public_key - Returns the public key of a CSR
Manual
Code Examples

openssl_csr_get_public_key(
     OpenSSLCertificateSigningRequest|string$csr,
     [bool$short_names = true]
): OpenSSLAsymmetricKey|false

openssl_csr_get_public_key extracts the public key from csr and prepares it for use by other functions.

Parameters

csr

See CSR parameters for a list of valid values.

short_names
Warning:

This parameter is ignored

Return Values

Returns an OpenSSLAsymmetricKey on success, or false on error.

Changelog

Version Description
8.0.0 On success, this function returns an OpenSSLAsymmetricKey instance now; previously, a resource of type OpenSSL key was returned.
8.0.0 csr accepts an OpenSSLCertificateSigningRequest instance now; previously, a resource of type OpenSSL X.509 CSR was accepted.

Related Functions

Example of openssl_csr_get_public_key

Show all examples for openssl_csr_get_public_key

PHP Version:


Function openssl_csr_get_public_key:

OpenSSL Functions

Most used PHP functions