PHP.nl

openssl_pkey_get_details

openssl_pkey_get_details

Returns an array with the key details

 **openssl_pkey_get_details** OpenSSLAsymmetricKey $key

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

keyResource holding the key.

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

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

  • , an additional array key named , containing the key data is returned. OPENSSL_KEYTYPE_RSA``"rsa"
  • , an additional array key named , containing the key data is returned. OPENSSL_KEYTYPE_DSA``"dsa"
  • , an additional array key named , containing the key data is returned. OPENSSL_KEYTYPE_DH``"dh"
  • , , , or an additional array key named , , , or respectively, is returned, containing the key data. OPENSSL_KEYTYPE_X25519``OPENSSL_KEYTYPE_ED25519``OPENSSL_KEYTYPE_X448``OPENSSL_KEYTYPE_ED448``"x25519"``"ed25519"``"x448"``"ed448"