ves-io-schema-kms_key-API-Create

Examples of creating kms_key

Usecase:

Create kms-rsa-key-default

Request using vesctl:

vesctl configuration create kms_key -i kms_key.yaml

where file kmskey.yaml has following contents (kmskey.CreateRequest):

metadata:
  name: kms-rsa-key-default
  namespace: documentation
spec:
  keyInfo:
    rsaKey: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: kms-rsa-key-default
  namespace: documentation
spec:
  policies: []
systemMetadata:
  creationTimestamp: "2021-07-14T08:07:20.389317339Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: f081e42a-84ac-47d7-9532-7d8f983efe12

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-rsa-key-default","namespace":"documentation"},"spec":{"keyInfo":{"rsaKey":{}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/kms/namespaces/documentation/kms_keys'

curl response:

HTTP/1.1 200 OK
Content-Length: 695
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:20 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-rsa-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "f081e42a-84ac-47d7-9532-7d8f983efe12",
    "creation_timestamp": "2021-07-14T08:07:20.389317339Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "sensitivity": "SENSITIVITY_MEDIUM",
    "policies": [
    ],
    "max_cache_age": null
  }
}

Usecase:

Create kms-rsa-key-with-params

Request using vesctl:

vesctl configuration create kms_key -i kms_key.yaml

where file kmskey.yaml has following contents (kmskey.CreateRequest):

metadata:
  name: kms-rsa-key-with-params
  namespace: documentation
spec:
  keyInfo:
    rsaKey:
      params:
        ESSchemes:
        - RSAES_OAEP
        - RSAES_PKCS1_V15
        SSASchemes:
        - RSASSA_PKCS1_V15
        - RSASSA_PSS
        hashAlgos:
        - SHA256
        keySize: 2048
  sensitivity: SENSITIVITY_LOW

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: kms-rsa-key-with-params
  namespace: documentation
spec:
  policies: []
  sensitivity: SENSITIVITY_LOW
systemMetadata:
  creationTimestamp: "2021-07-14T08:07:20.394343029Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 8d79ce15-ecdf-4d7a-abbf-43131da1f584

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-rsa-key-with-params","namespace":"documentation"},"spec":{"sensitivity":"SENSITIVITY_LOW","keyInfo":{"rsaKey":{"params":{"keySize":2048,"ESSchemes":["RSAES_OAEP","RSAES_PKCS1_V15"],"SSASchemes":["RSASSA_PKCS1_V15","RSASSA_PSS"],"hashAlgos":["SHA256"]}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/kms/namespaces/documentation/kms_keys'

curl response:

HTTP/1.1 200 OK
Content-Length: 696
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:20 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-rsa-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "8d79ce15-ecdf-4d7a-abbf-43131da1f584",
    "creation_timestamp": "2021-07-14T08:07:20.394343029Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "sensitivity": "SENSITIVITY_LOW",
    "policies": [
    ],
    "max_cache_age": null
  }
}

Usecase:

Create kms-aes-key-default

Request using vesctl:

vesctl configuration create kms_key -i kms_key.yaml

where file kmskey.yaml has following contents (kmskey.CreateRequest):

metadata:
  name: kms-aes-key-default
  namespace: documentation
spec:
  keyInfo:
    aesKey: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: kms-aes-key-default
  namespace: documentation
spec:
  policies: []
systemMetadata:
  creationTimestamp: "2021-07-14T08:07:20.398581726Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 5a0da03d-52d1-4b7f-97bd-bb7c0ef463f6

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-aes-key-default","namespace":"documentation"},"spec":{"keyInfo":{"aesKey":{}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/kms/namespaces/documentation/kms_keys'

curl response:

HTTP/1.1 200 OK
Content-Length: 695
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:20 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-aes-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "5a0da03d-52d1-4b7f-97bd-bb7c0ef463f6",
    "creation_timestamp": "2021-07-14T08:07:20.398581726Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "sensitivity": "SENSITIVITY_MEDIUM",
    "policies": [
    ],
    "max_cache_age": null
  }
}

Usecase:

Create kms-aes-key-with-params

Request using vesctl:

vesctl configuration create kms_key -i kms_key.yaml

where file kmskey.yaml has following contents (kmskey.CreateRequest):

metadata:
  name: kms-aes-key-with-params
  namespace: documentation
spec:
  keyInfo:
    aesKey:
      params:
        keySize: 256
        nonceSizeMax: 256
        nonceSizeMin: 96
  sensitivity: SENSITIVITY_LOW

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: kms-aes-key-with-params
  namespace: documentation
spec:
  policies: []
  sensitivity: SENSITIVITY_LOW
systemMetadata:
  creationTimestamp: "2021-07-14T08:07:20.402175372Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 7cce80e3-9f7d-4009-b22d-f865ceacbaa4

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-aes-key-with-params","namespace":"documentation"},"spec":{"sensitivity":"SENSITIVITY_LOW","keyInfo":{"aesKey":{"params":{"keySize":256,"nonceSizeMin":96,"nonceSizeMax":256}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/kms/namespaces/documentation/kms_keys'

curl response:

HTTP/1.1 200 OK
Content-Length: 696
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:20 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-aes-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "7cce80e3-9f7d-4009-b22d-f865ceacbaa4",
    "creation_timestamp": "2021-07-14T08:07:20.402175372Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "sensitivity": "SENSITIVITY_LOW",
    "policies": [
    ],
    "max_cache_age": null
  }
}

Usecase:

Create kms-hmac-key-default

Request using vesctl:

vesctl configuration create kms_key -i kms_key.yaml

where file kmskey.yaml has following contents (kmskey.CreateRequest):

metadata:
  name: kms-hmac-key-default
  namespace: documentation
spec:
  keyInfo:
    hmacKey: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: kms-hmac-key-default
  namespace: documentation
spec:
  policies: []
systemMetadata:
  creationTimestamp: "2021-07-14T08:07:20.407060814Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: a2f0d216-2321-4460-900a-40ef94cd3479

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-hmac-key-default","namespace":"documentation"},"spec":{"keyInfo":{"hmacKey":{}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/kms/namespaces/documentation/kms_keys'

curl response:

HTTP/1.1 200 OK
Content-Length: 696
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:20 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-hmac-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "a2f0d216-2321-4460-900a-40ef94cd3479",
    "creation_timestamp": "2021-07-14T08:07:20.407060814Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "sensitivity": "SENSITIVITY_MEDIUM",
    "policies": [
    ],
    "max_cache_age": null
  }
}

Usecase:

Create kms-hmac-key-with-params

Request using vesctl:

vesctl configuration create kms_key -i kms_key.yaml

where file kmskey.yaml has following contents (kmskey.CreateRequest):

metadata:
  name: kms-hmac-key-with-params
  namespace: documentation
spec:
  keyInfo:
    hmacKey:
      params:
        algoList:
        - SHA256
        keySize: 256
  sensitivity: SENSITIVITY_LOW

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: kms-hmac-key-with-params
  namespace: documentation
spec:
  policies: []
  sensitivity: SENSITIVITY_LOW
systemMetadata:
  creationTimestamp: "2021-07-14T08:07:20.411740541Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: d253ea03-6ffb-42d4-81b9-ec192d4ea1bd

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-hmac-key-with-params","namespace":"documentation"},"spec":{"sensitivity":"SENSITIVITY_LOW","keyInfo":{"hmacKey":{"params":{"keySize":256,"algoList":["SHA256"]}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/kms/namespaces/documentation/kms_keys'

curl response:

HTTP/1.1 200 OK
Content-Length: 697
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:20 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-hmac-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "d253ea03-6ffb-42d4-81b9-ec192d4ea1bd",
    "creation_timestamp": "2021-07-14T08:07:20.411740541Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "sensitivity": "SENSITIVITY_LOW",
    "policies": [
    ],
    "max_cache_age": null
  }
}