{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-certificate-manager/json-schema/google-cloud-certificate-manager-certificate-template-schema.json",
  "title": "CertificateTemplate",
  "description": "A CertificateTemplate refers to a managed template for certificate issuance.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-certificate-manager-privateca-projects-api-openapi.yml#/components/schemas/CertificateTemplate",
  "type": "object",
  "properties": {
    "maximumLifetime": {
      "format": "google-duration",
      "type": "string",
      "description": "Optional. The maximum lifetime allowed for issued Certificates that use this template. If the issuing CaPool resource's IssuancePolicy specifies a maximum_lifetime the minimum of the two durations will be the maximum lifetime for issued Certificates. Note that if the issuing CertificateAuthority expires before a Certificate's requested maximum_lifetime, the effective lifetime will be explicitly truncated to match it."
    },
    "labels": {
      "description": "Optional. Labels with user-defined metadata.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "name": {
      "description": "Identifier. The resource name for this CertificateTemplate in the format `projects/*/locations/*/certificateTemplates/*`.",
      "type": "string"
    },
    "passthroughExtensions": {
      "$ref": "#/$defs/CertificateExtensionConstraints",
      "description": "Optional. Describes the set of X.509 extensions that may appear in a Certificate issued using this CertificateTemplate. If a certificate request sets extensions that don't appear in the passthrough_extensions, those extensions will be dropped. If the issuing CaPool's IssuancePolicy defines baseline_values that don't appear here, the certificate issuance request will fail. If this is omitted, then this template will not add restrictions on a certificate's X.509 extensions. These constraints do not apply to X.509 extensions set in this CertificateTemplate's predefined_values."
    },
    "predefinedValues": {
      "$ref": "#/$defs/X509Parameters",
      "description": "Optional. A set of X.509 values that will be applied to all issued certificates that use this template. If the certificate request includes conflicting values for the same properties, they will be overwritten by the values defined here. If the issuing CaPool's IssuancePolicy defines conflicting baseline_values for the same properties, the certificate issuance request will fail."
    },
    "description": {
      "description": "Optional. A human-readable description of scenarios this template is intended for.",
      "type": "string"
    },
    "identityConstraints": {
      "$ref": "#/$defs/CertificateIdentityConstraints",
      "description": "Optional. Describes constraints on identities that may be appear in Certificates issued using this template. If this is omitted, then this template will not add restrictions on a certificate's identity."
    },
    "updateTime": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. The time at which this CertificateTemplate was updated.",
      "format": "google-datetime"
    },
    "createTime": {
      "type": "string",
      "description": "Output only. The time at which this CertificateTemplate was created.",
      "format": "google-datetime",
      "readOnly": true
    }
  },
  "$defs": {
    "CaOptions": {
      "type": "object",
      "properties": {
        "maxIssuerPathLength": {
          "type": "integer",
          "description": "Optional. Refers to the path length constraint field in the X.509 extension. For a CA certificate, this value describes the depth of subordinate CA certificates that are allowed. If this value is less than 0, the request will fail. If this value is missing, the max path length will be omitted from the certificate.",
          "format": "int32"
        },
        "isCa": {
          "type": "boolean",
          "description": "Optional. Refers to the \"CA\" boolean field in the X.509 extension. When this value is missing, the basic constraints extension will be omitted from the certificate."
        }
      },
      "description": "Describes the X.509 basic constraints extension, per [RFC 5280 section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9)"
    },
    "CertificateExtensionConstraints": {
      "type": "object",
      "description": "Describes a set of X.509 extensions that may be part of some certificate issuance controls.",
      "properties": {
        "additionalExtensions": {
          "items": {
            "$ref": "#/$defs/ObjectId"
          },
          "description": "Optional. A set of ObjectIds identifying custom X.509 extensions. Will be combined with known_extensions to determine the full set of X.509 extensions.",
          "type": "array"
        },
        "knownExtensions": {
          "description": "Optional. A set of named X.509 extensions. Will be combined with additional_extensions to determine the full set of X.509 extensions.",
          "items": {
            "type": "string",
            "enum": [
              "KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED",
              "BASE_KEY_USAGE",
              "EXTENDED_KEY_USAGE",
              "CA_OPTIONS",
              "POLICY_IDS",
              "AIA_OCSP_SERVERS",
              "NAME_CONSTRAINTS"
            ]
          },
          "type": "array"
        }
      }
    },
    "CertificateIdentityConstraints": {
      "description": "Describes constraints on a Certificate's Subject and SubjectAltNames.",
      "properties": {
        "allowSubjectAltNamesPassthrough": {
          "description": "Required. If this is true, the SubjectAltNames extension may be copied from a certificate request into the signed certificate. Otherwise, the requested SubjectAltNames will be discarded.",
          "type": "boolean"
        },
        "allowSubjectPassthrough": {
          "description": "Required. If this is true, the Subject field may be copied from a certificate request into the signed certificate. Otherwise, the requested Subject will be discarded.",
          "type": "boolean"
        },
        "celExpression": {
          "$ref": "#/$defs/Expr",
          "description": "Optional. A CEL expression that may be used to validate the resolved X.509 Subject and/or Subject Alternative Name before a certificate is signed. To see the full allowed syntax and some examples, see https://cloud.google.com/certificate-authority-service/docs/using-cel"
        }
      },
      "type": "object"
    },
    "Expr": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression."
        },
        "description": {
          "description": "Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.",
          "type": "string"
        },
        "location": {
          "description": "Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.",
          "type": "string"
        },
        "expression": {
          "description": "Textual representation of an expression in Common Expression Language syntax.",
          "type": "string"
        }
      },
      "description": "Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: \"Summary size limit\" description: \"Determines if a summary is less than 100 chars\" expression: \"document.summary.size() < 100\" Example (Equality): title: \"Requestor is owner\" description: \"Determines if requestor is the document owner\" expression: \"document.owner == request.auth.claims.email\" Example (Logic): title: \"Public documents\" description: \"Determine whether the document should be publicly visible\" expression: \"document.type != 'private' && document.type != 'internal'\" Example (Data Manipulation): title: \"Notification string\" description: \"Create a notification string with a timestamp.\" expression: \"'New message received at ' + string(document.create_time)\" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information."
    },
    "ExtendedKeyUsageOptions": {
      "properties": {
        "codeSigning": {
          "type": "boolean",
          "description": "Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as \"Signing of downloadable executable code client authentication\"."
        },
        "emailProtection": {
          "description": "Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as \"Email protection\".",
          "type": "boolean"
        },
        "ocspSigning": {
          "type": "boolean",
          "description": "Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as \"Signing OCSP responses\"."
        },
        "serverAuth": {
          "description": "Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as \"TLS WWW server authentication\", though regularly used for non-WWW TLS.",
          "type": "boolean"
        },
        "clientAuth": {
          "description": "Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as \"TLS WWW client authentication\", though regularly used for non-WWW TLS.",
          "type": "boolean"
        },
        "timeStamping": {
          "description": "Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as \"Binding the hash of an object to a time\".",
          "type": "boolean"
        }
      },
      "description": "KeyUsage.ExtendedKeyUsageOptions has fields that correspond to certain common OIDs that could be specified as an extended key usage value.",
      "type": "object"
    },
    "KeyUsage": {
      "properties": {
        "extendedKeyUsage": {
          "$ref": "#/$defs/ExtendedKeyUsageOptions",
          "description": "Detailed scenarios in which a key may be used."
        },
        "unknownExtendedKeyUsages": {
          "description": "Used to describe extended key usages that are not listed in the KeyUsage.ExtendedKeyUsageOptions message.",
          "items": {
            "$ref": "#/$defs/ObjectId"
          },
          "type": "array"
        },
        "baseKeyUsage": {
          "$ref": "#/$defs/KeyUsageOptions",
          "description": "Describes high-level ways in which a key may be used."
        }
      },
      "type": "object",
      "description": "A KeyUsage describes key usage values that may appear in an X.509 certificate."
    },
    "KeyUsageOptions": {
      "description": "KeyUsage.KeyUsageOptions corresponds to the key usage values described in https://tools.ietf.org/html/rfc5280#section-4.2.1.3.",
      "properties": {
        "dataEncipherment": {
          "type": "boolean",
          "description": "The key may be used to encipher data."
        },
        "certSign": {
          "description": "The key may be used to sign certificates.",
          "type": "boolean"
        },
        "keyEncipherment": {
          "type": "boolean",
          "description": "The key may be used to encipher other keys."
        },
        "encipherOnly": {
          "type": "boolean",
          "description": "The key may be used to encipher only."
        },
        "contentCommitment": {
          "description": "The key may be used for cryptographic commitments. Note that this may also be referred to as \"non-repudiation\".",
          "type": "boolean"
        },
        "keyAgreement": {
          "type": "boolean",
          "description": "The key may be used in a key agreement protocol."
        },
        "digitalSignature": {
          "description": "The key may be used for digital signatures.",
          "type": "boolean"
        },
        "decipherOnly": {
          "description": "The key may be used to decipher only.",
          "type": "boolean"
        },
        "crlSign": {
          "type": "boolean",
          "description": "The key may be used sign certificate revocation lists."
        }
      },
      "type": "object"
    },
    "NameConstraints": {
      "type": "object",
      "description": "Describes the X.509 name constraints extension, per https://tools.ietf.org/html/rfc5280#section-4.2.1.10",
      "properties": {
        "permittedDnsNames": {
          "description": "Contains permitted DNS names. Any DNS name that can be constructed by simply adding zero or more labels to the left-hand side of the name satisfies the name constraint. For example, `example.com`, `www.example.com`, `www.sub.example.com` would satisfy `example.com` while `example1.com` does not.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excludedEmailAddresses": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Contains the excluded email addresses. The value can be a particular email address, a hostname to indicate all email addresses on that host or a domain with a leading period (e.g. `.example.com`) to indicate all email addresses in that domain."
        },
        "permittedEmailAddresses": {
          "description": "Contains the permitted email addresses. The value can be a particular email address, a hostname to indicate all email addresses on that host or a domain with a leading period (e.g. `.example.com`) to indicate all email addresses in that domain.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "excludedUris": {
          "type": "array",
          "description": "Contains the excluded URIs that apply to the host part of the name. The value can be a hostname or a domain with a leading period (like `.example.com`)",
          "items": {
            "type": "string"
          }
        },
        "permittedIpRanges": {
          "items": {
            "type": "string"
          },
          "description": "Contains the permitted IP ranges. For IPv4 addresses, the ranges are expressed using CIDR notation as specified in RFC 4632. For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 addresses.",
          "type": "array"
        },
        "excludedIpRanges": {
          "items": {
            "type": "string"
          },
          "description": "Contains the excluded IP ranges. For IPv4 addresses, the ranges are expressed using CIDR notation as specified in RFC 4632. For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 addresses.",
          "type": "array"
        },
        "critical": {
          "type": "boolean",
          "description": "Indicates whether or not the name constraints are marked critical."
        },
        "excludedDnsNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Contains excluded DNS names. Any DNS name that can be constructed by simply adding zero or more labels to the left-hand side of the name satisfies the name constraint. For example, `example.com`, `www.example.com`, `www.sub.example.com` would satisfy `example.com` while `example1.com` does not."
        },
        "permittedUris": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Contains the permitted URIs that apply to the host part of the name. The value can be a hostname or a domain with a leading period (like `.example.com`)"
        }
      }
    },
    "ObjectId": {
      "description": "An ObjectId specifies an object identifier (OID). These provide context and describe types in ASN.1 messages.",
      "properties": {
        "objectIdPath": {
          "items": {
            "type": "integer",
            "format": "int32"
          },
          "type": "array",
          "description": "Required. The parts of an OID path. The most significant parts of the path come first."
        }
      },
      "type": "object"
    },
    "X509Extension": {
      "properties": {
        "objectId": {
          "$ref": "#/$defs/ObjectId",
          "description": "Required. The OID for this X.509 extension."
        },
        "critical": {
          "type": "boolean",
          "description": "Optional. Indicates whether or not this extension is critical (i.e., if the client does not know how to handle this extension, the client should consider this to be an error)."
        },
        "value": {
          "type": "string",
          "format": "byte",
          "description": "Required. The value of this X.509 extension."
        }
      },
      "description": "An X509Extension specifies an X.509 extension, which may be used in different parts of X.509 objects like certificates, CSRs, and CRLs.",
      "type": "object"
    },
    "X509Parameters": {
      "description": "An X509Parameters is used to describe certain fields of an X.509 certificate, such as the key usage fields, fields specific to CA certificates, certificate policy extensions and custom extensions.",
      "type": "object",
      "properties": {
        "caOptions": {
          "$ref": "#/$defs/CaOptions",
          "description": "Optional. Describes options in this X509Parameters that are relevant in a CA certificate. If not specified, a default basic constraints extension with `is_ca=false` will be added for leaf certificates."
        },
        "policyIds": {
          "description": "Optional. Describes the X.509 certificate policy object identifiers, per https://tools.ietf.org/html/rfc5280#section-4.2.1.4.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ObjectId"
          }
        },
        "aiaOcspServers": {
          "items": {
            "type": "string"
          },
          "description": "Optional. Describes Online Certificate Status Protocol (OCSP) endpoint addresses that appear in the \"Authority Information Access\" extension in the certificate.",
          "type": "array"
        },
        "additionalExtensions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/X509Extension"
          },
          "description": "Optional. Describes custom X.509 extensions."
        },
        "nameConstraints": {
          "$ref": "#/$defs/NameConstraints",
          "description": "Optional. Describes the X.509 name constraints extension."
        },
        "keyUsage": {
          "$ref": "#/$defs/KeyUsage",
          "description": "Optional. Indicates the intended use for keys that correspond to a certificate."
        }
      }
    }
  }
}