(PHP 5 >= 5.6.0, PHP 7)
openssl_spki_export — ͨ��ǩ����Կ����ս����һ�����õ�PEM��ʽ�Ĺ�Կ
&$spkac
) : string�ӱ����ǩ����Կ����ս����PEM��ʽ�Ĺ�Կ��
spkac
����һ����Ч��ǩ����Կ����ս�ַ�����
�ɹ������ع�����PEM��ʽ�Ĺ�Կ��ʧ���� NULL.
������ݸ� spkac
������һ�������õIJ���������׳�һ��E_WARNING
���ľ��档
Example #1 openssl_spki_export() ������
�ɹ������ع�����PEM��ʽ�Ĺ�Կ��ʧ���� NULL.
<?php
$pkey = openssl_pkey_new('secret password');
$spkac = openssl_spki_new($pkey, 'challenge string');
$pubKey = openssl_spki_export(preg_replace('/SPKAC=/', '', $spkac));
if ($pubKey) {
echo $pubKey;
}
?>
Example #2 openssl_spki_export() example from <keygen>
ͨ��<keygen> Ԫ�ص���������PEM��ʽ�Ĺ�Կ��
<?php
$spkac = openssl_spki_export(preg_replace('/SPKAC=/', '', $_POST['spkac']));
if ($spkac != NULL) {
echo $spkac;
} else {
echo "Extraction of pub key failed";
}
?>
<keygen name="spkac" challenge="challenge string" keytype="RSA">