openssl_csr_get_public_key

FunctionParams and return types changed in PHP 8.0

Returns the public key of a CSR.

PHP 5
PHP 7
PHP 8.0
Improved
PHP 8.1
PHP 8.2-8.3
PHP 8.4
PHP 8.5
PHP 8.6

openssl_csr_get_public_key Function synopsis

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

Parameters

$csr

TypeOpenSSLCertificateSigningRequest|string

$short_names

OptionalTypeboolDefault valuetrue

This parameter is ignored

Return value

TypeOpenSSLAsymmetricKey|false

Returns an OpenSSLAsymmetricKey on success, or false on error.

Changes to the openssl_csr_get_public_key Function

PHP 8.0

  • Return type added: OpenSSLAsymmetricKey|false
  • Parameter type added for parameter #1 ($csr): OpenSSLCertificateSigningRequest|string
  • Parameter name of parameter #2 changed: $use_shortnames to $short_names
  • Parameter type added for parameter #2 ($short_names): bool
  • Parameter default value added for position #2 ($short_names): true
- openssl_csr_get_public_key($csr, $use_shortnames)
+ openssl_csr_get_public_key(OpenSSLCertificateSigningRequest|string $csr, bool $short_names = true): OpenSSLAsymmetricKey|false

PHP 7.1

  • Optional parameter added - #2: $use_shortnames
- openssl_csr_get_public_key($csr)
+ openssl_csr_get_public_key($csr, $use_shortnames)

openssl_csr_get_public_key Function Availability

PHP VersionAvailability
PHP 8.6Upcoming Release Yes
PHP 8.5Supported (Latest) Yes
PHP 8.4Supported Yes
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Unsupported Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported Yes
PHP 7.2Unsupported Yes
PHP 7.1Unsupported Yes
PHP 7.0Unsupported Yes
PHP 5.6Unsupported Yes
PHP 5.5Unsupported Yes
PHP 5.4Unsupported Yes
PHP 5.3Unsupported Yes