(PHP 5 >= 5.6.0, PHP 7)
openssl_spki_verify — ��֤ǩ����Կ����ս��
&$spkac
) : string��֤���ṩ��ǩ����Կ����ս��
spkac
����һ����Ч��ǩ����Կ����ս��
�ɹ�������true, ʧ�ܷ���false.
���spkac
��������һ�����õIJ����������׳�һ�� E_WARNING
�ȼ��Ĵ���
Example #1 openssl_spki_verify() ������
��֤����ǩ����Կ����ս
<?php
$pkey = openssl_pkey_new('secret password');
$spkac = openssl_spki_new($pkey, 'challenge string');
if (openssl_spki_verify(preg_replace('/SPKAC=/', '', $spkac))) {
echo $spkac;
} else {
echo "SPKAC validation failed";
}
?>
Example #2 openssl_spki_verify() example from <keygen>
ͨ��<keygen> Ԫ����֤����ǩ����Կ����ս
<?php
if (openssl_spki_verify(preg_replace('/SPKAC=/', '', $_POST['spkac']))) {
echo $spkac;
} else {
echo "SPKAC validation failed";
}
?>
<keygen name="spkac" challenge="challenge string" keytype="RSA">