X509: add method to validate the purpose of a certificate