openssl_pkey_get_details

(PHP 5 >= 5.2.0, PHP 7)

openssl_pkey_get_details���ذ�����Կ���������

˵��

openssl_pkey_get_details ( resource $key ) : array

�ú���������Կ����(λ���ȣ���Կ������).

����

key

������Կ����Դ��

����ֵ

�ɹ������ذ�����Կ��������飬ʧ�ܷ��� FALSE . ���ص������а��������������� bits (λ��), key (��ʾ��Կ���ַ���) �� type (������Կ����֮һ�� OPENSSL_KEYTYPE_RSA, OPENSSL_KEYTYPE_DSA, OPENSSL_KEYTYPE_DH, OPENSSL_KEYTYPE_EC ���� δ֪���ͷ���1).

ȡ������ʹ����Կ�����ͣ����ܻ᷵�������������Ϣ����ע�⣬��ЩԪ�ؿ��ܲ������ǿ��õġ�

  • OPENSSL_KEYTYPE_RSA, һ������ļ���Ϊ "rsa"�����飬������������Կ���ݣ�
    Key ˵��
    "n" modulus
    "e" public exponent
    "d" private exponent
    "p" prime 1
    "q" prime 2
    "dmp1" exponent1, d mod (p-1)
    "dmq1" exponent2, d mod (q-1)
    "iqmp" coefficient, (inverse of q) mod p
  • OPENSSL_KEYTYPE_DSA, һ������ļ�Ϊ "dsa" �����飬 �������µ���Կ���ݡ�
    Key ˵��
    "p" prime number (public)
    "q" 160-bit subprime, q | p-1 (public)
    "g" generator of subgroup (public)
    "priv_key" private key x
    "pub_key" public key y = g^x
  • OPENSSL_KEYTYPE_DH, һ������ļ�Ϊ "dh" �����飬�������µ���Կ���ݡ�
    Key ˵��
    "p" prime number (shared)
    "g" generator of Z_p (shared)
    "priv_key" private DH value x
    "pub_key" public DH value g^x
  • OPENSSL_KEYTYPE_EC, һ������ļ�Ϊ "ec" ������,�������µ���Կ���ݡ�
    Key ˵��
    "curve_name" name of curve, see openssl_get_curve_names()
    "curve_oid" ASN1 Object identifier (OID) for EC curve.
    "x" x coordinate (public)
    "y" y coordinate (public)
    "d" private key