I want to use the PHP function openssl_verify() to verify the signatures of different X.509 certificates.
I have all it needs (certificate, $data, $signature, $pub_key_id) except of the signature algorithm but which is stored in the certificate.

My simple question is: How can I extract signature algorithm from certificates?
Look at this question, you can do it similar, try this: