array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.openssl-pkey-get-details.php', 1 => 'openssl_pkey_get_details', 2 => 'Returns an array with the key details', ), 'up' => array ( 0 => 'ref.openssl.php', 1 => 'Функції OpenSSL', ), 'prev' => array ( 0 => 'function.openssl-pkey-free.php', 1 => 'openssl_pkey_free', ), 'next' => array ( 0 => 'function.openssl-pkey-get-private.php', 1 => 'openssl_pkey_get_private', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/openssl/functions/openssl-pkey-get-details.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

openssl_pkey_get_details

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

openssl_pkey_get_detailsReturns an array with the key details

Опис

openssl_pkey_get_details(OpenSSLAsymmetricKey $key): array|false

This function returns the key details (bits, key, type).

Параметри

key

Resource holding the key.

Значення, що повертаються

Returns an array with the key details on success or false on failure. Returned array has indexes bits (number of bits), key (string representation of the public key) and type (type of the key which is one of OPENSSL_KEYTYPE_RSA, OPENSSL_KEYTYPE_DSA, OPENSSL_KEYTYPE_DH, OPENSSL_KEYTYPE_EC, OPENSSL_KEYTYPE_X25519, OPENSSL_KEYTYPE_ED25519, OPENSSL_KEYTYPE_X448, OPENSSL_KEYTYPE_ED448, or -1 meaning unknown).

Depending on the key type used, additional details may be returned. Note that some elements may not always be available.

Журнал змін

Версія Опис
8.4.0 Added support for Curve25519 and Curve448 based keys. Specifically the x25519, ed25519, x448 and ed448 fields have been introduced.
8.0.0 key accepts an OpenSSLAsymmetricKey now; previously, a resource of type OpenSSL key was accepted.