Skip to main content

certificates

Creates, updates, deletes, gets or lists a certificates resource.

Overview

Namecertificates
TypeResource
Idgoogle.privateca.certificates

Fields

NameDatatypeDescription
namestringOutput only. The resource name for this Certificate in the format projects/*/locations/*/caPools/*/certificates/*.
certificateDescriptionobjectA CertificateDescription describes an X.509 certificate or CSR that has been issued, as an alternative to using ASN.1 / X.509.
certificateTemplatestringImmutable. The resource name for a CertificateTemplate used to issue this certificate, in the format projects/*/locations/*/certificateTemplates/*. If this is specified, the caller must have the necessary permission to use this template. If this is omitted, no template will be used. This template must be in the same location as the Certificate.
configobjectA CertificateConfig describes an X.509 certificate or CSR that is to be created, as an alternative to using ASN.1.
createTimestringOutput only. The time at which this Certificate was created.
issuerCertificateAuthoritystringOutput only. The resource name of the issuing CertificateAuthority in the format projects/*/locations/*/caPools/*/certificateAuthorities/*.
labelsobjectOptional. Labels with user-defined metadata.
lifetimestringRequired. Immutable. The desired lifetime of a certificate. Used to create the "not_before_time" and "not_after_time" fields inside an X.509 certificate. Note that the lifetime may be truncated if it would extend past the life of any certificate authority in the issuing chain.
pemCertificatestringOutput only. The pem-encoded, signed X.509 certificate.
pemCertificateChainarrayOutput only. The chain that may be used to verify the X.509 certificate. Expected to be in issuer-to-root order according to RFC 5246.
pemCsrstringImmutable. A pem-encoded X.509 certificate signing request (CSR).
revocationDetailsobjectDescribes fields that are relavent to the revocation of a Certificate.
subjectModestringImmutable. Specifies how the Certificate's identity fields are to be decided. If this is omitted, the DEFAULT subject mode will be used.
updateTimestringOutput only. The time at which this Certificate was updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTcaPoolsId, certificatesId, locationsId, projectsIdReturns a Certificate.
listSELECTcaPoolsId, locationsId, projectsIdLists Certificates.
createINSERTcaPoolsId, locationsId, projectsIdCreate a new Certificate in a given Project, Location from a particular CaPool.
patchUPDATEcaPoolsId, certificatesId, locationsId, projectsIdUpdate a Certificate. Currently, the only field you can update is the labels field.
revokeEXECcaPoolsId, certificatesId, locationsId, projectsIdRevoke a Certificate.

SELECT examples

Lists Certificates.

SELECT
name,
certificateDescription,
certificateTemplate,
config,
createTime,
issuerCertificateAuthority,
labels,
lifetime,
pemCertificate,
pemCertificateChain,
pemCsr,
revocationDetails,
subjectMode,
updateTime
FROM google.privateca.certificates
WHERE caPoolsId = '{{ caPoolsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new certificates resource.

/*+ create */
INSERT INTO google.privateca.certificates (
caPoolsId,
locationsId,
projectsId,
pemCsr,
config,
lifetime,
certificateTemplate,
subjectMode,
labels
)
SELECT
'{{ caPoolsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ pemCsr }}',
'{{ config }}',
'{{ lifetime }}',
'{{ certificateTemplate }}',
'{{ subjectMode }}',
'{{ labels }}'
;

UPDATE example

Updates a certificates resource.

/*+ update */
UPDATE google.privateca.certificates
SET
pemCsr = '{{ pemCsr }}',
config = '{{ config }}',
lifetime = '{{ lifetime }}',
certificateTemplate = '{{ certificateTemplate }}',
subjectMode = '{{ subjectMode }}',
labels = '{{ labels }}'
WHERE
caPoolsId = '{{ caPoolsId }}'
AND certificatesId = '{{ certificatesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';