int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose [, array $cainfo = array() [, string $untrustedfile ]] )
openssl_x509_checkpurpose() examines a certificate to see if it can be used for the specified purpose.
Returns TRUE if the certificate can be used for the intended purpose, FALSE if it cannot, or -1 on error.