Google Cloud KMS Crypto Keys API

The Crypto Keys API from Google Cloud KMS — 2 operation(s) for crypto keys.

OpenAPI Specification

google-cloud-kms-crypto-keys-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Cloud KMS Crypto Keys API
  description: The Cloud KMS API enables creating and managing cryptographic keys, key rings, and crypto key versions, and performing encrypt, decrypt, sign, and verify operations.
  version: 1.0.0
  contact:
    name: Google Cloud
    url: https://cloud.google.com/kms
servers:
- url: https://cloudkms.googleapis.com/v1
  description: Google Cloud KMS Production
tags:
- name: Crypto Keys
paths:
  /projects/{projectId}/locations/{location}/keyRings/{keyRingId}/cryptoKeys:
    get:
      operationId: listCryptoKeys
      summary: Google Cloud KMS List crypto keys
      description: Lists crypto keys in a key ring.
      tags:
      - Crypto Keys
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: keyRingId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  cryptoKeys:
                    type: array
                    items:
                      $ref: '#/components/schemas/CryptoKey'
                  nextPageToken:
                    type: string
    post:
      operationId: createCryptoKey
      summary: Google Cloud KMS Create a crypto key
      description: Creates a new crypto key within a key ring.
      tags:
      - Crypto Keys
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: keyRingId
        in: path
        required: true
        schema:
          type: string
      - name: cryptoKeyId
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoKey'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoKey'
  /projects/{projectId}/locations/{location}/keyRings/{keyRingId}/cryptoKeys/{cryptoKeyId}:
    get:
      operationId: getCryptoKey
      summary: Google Cloud KMS Get a crypto key
      description: Retrieves a specific crypto key.
      tags:
      - Crypto Keys
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: keyRingId
        in: path
        required: true
        schema:
          type: string
      - name: cryptoKeyId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoKey'
    patch:
      operationId: updateCryptoKey
      summary: Google Cloud KMS Update a crypto key
      description: Updates a crypto key.
      tags:
      - Crypto Keys
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: keyRingId
        in: path
        required: true
        schema:
          type: string
      - name: cryptoKeyId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoKey'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoKey'
components:
  schemas:
    CryptoKeyVersion:
      type: object
      properties:
        name:
          type: string
          description: Resource name of the crypto key version.
        state:
          type: string
          enum:
          - CRYPTO_KEY_VERSION_STATE_UNSPECIFIED
          - PENDING_GENERATION
          - ENABLED
          - DISABLED
          - DESTROYED
          - DESTROY_SCHEDULED
          - PENDING_IMPORT
          - IMPORT_FAILED
        protectionLevel:
          type: string
          description: Protection level of the key version.
        algorithm:
          type: string
          description: Algorithm of the key version.
        createTime:
          type: string
          format: date-time
        generateTime:
          type: string
          format: date-time
        destroyTime:
          type: string
          format: date-time
        destroyEventTime:
          type: string
          format: date-time
    CryptoKey:
      type: object
      properties:
        name:
          type: string
          description: Resource name of the crypto key.
        primary:
          $ref: '#/components/schemas/CryptoKeyVersion'
        purpose:
          type: string
          enum:
          - CRYPTO_KEY_PURPOSE_UNSPECIFIED
          - ENCRYPT_DECRYPT
          - ASYMMETRIC_SIGN
          - ASYMMETRIC_DECRYPT
          - MAC
          description: Purpose of the crypto key.
        createTime:
          type: string
          format: date-time
          description: Timestamp when the key was created.
        nextRotationTime:
          type: string
          format: date-time
          description: Timestamp of the next scheduled rotation.
        rotationPeriod:
          type: string
          description: Rotation period in seconds.
        versionTemplate:
          type: object
          properties:
            protectionLevel:
              type: string
              enum:
              - PROTECTION_LEVEL_UNSPECIFIED
              - SOFTWARE
              - HSM
              - EXTERNAL
              - EXTERNAL_VPC
            algorithm:
              type: string
        destroyScheduledDuration:
          type: string
          description: Duration before a key version is destroyed after scheduling.
        labels:
          type: object
          additionalProperties:
            type: string
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/cloudkms: Manage KMS resources
            https://www.googleapis.com/auth/cloud-platform: Full access to Google Cloud