Sort and filter certificates
This page describes how you can sort and filter the certificates that are returned
by the ListCertificates
API call in Certificate Authority Service.
For information about listing and viewing issued certificates, see View issued certificates.
Sorting support
By default, the ListCertificates
API call returns the certificates ordered by the create_time
field, with the newest certificates being listed first. No other sort order can be specified.
Filtering support
The following fields can be used for filtering the certificates returned by the ListCertificates
API call:
Note: The fields certificate_description.x509_description.key_usage.extended_key_usage.client_auth and certificate_description.x509_description.key_usage.extended_key_usage.server_auth are booleans that refer to whether the respective Extended Key Usages are present.
Filtering syntax
The filtering syntax is following the API Filtering guidance set in AIP 160 with the following limitations:
only top level
AND
operators are supported. Everything else is not (for example,OR
,NOT
, nested operators, or any combination of these operators).Valid: Filter uses only top level AND operator:
create_time>"2020-08-21T11:30:00.11-05:00" AND certificate_description.x509_description.key_usage.extended_key_usage.server_auth=true
Invalid: Filter uses OR operator:
create_time>"2020-08-21T11:30:00.11-05:00" OR certificate_description.x509_description.key_usage.extended_key_usage.server_auth=true
Invalid: Filter uses nested operators:
(create_time>"2020-08-21T11:30:00.11-05:00" AND certificate_description.x509_description.key_usage.extended_key_usage.server_auth=true) AND certificate_description.subject_description.subject.common_name="foo.com"
wildcard matching (using
*
) is not supported except for thecertificate_description.subject_description.subject_alt_name.dns_names
field which supports suffix matching for the DNS labels.Valid: Filter compares a wildcard suffix match:
certificate_description.subject_description.subject_alt_name.dns_names:"*.foo.com"
Invalid: Filter compares with a wildcard prefix match:
certificate_description.subject_description.subject_alt_name.dns_names:"foo.*"
Invalid: Filter compares with a wildcard for an unsupported field:
"certificate_description.subject_description.hex_serial_number"="*3d3"
What's next
- Learn how to request certificates.
- Learn how to revoke certificates.
- See the REST API reference documentation.
- See the RPC API reference documentation.