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-05-12T11:18:03.882558640Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 8846cdac-da94-4a69-999b-8fe5aae4b0a7

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-build672621555_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, 12 May 2021 11:18:03 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-rsa-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "8846cdac-da94-4a69-999b-8fe5aae4b0a7",
    "creation_timestamp": "2021-05-12T11:18:03.882558640Z",
    "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-05-12T11:18:03.886321765Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 0aea3cd2-62d9-4eed-b702-cb3bd96f1c09

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-build672621555_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, 12 May 2021 11:18:03 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-rsa-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "0aea3cd2-62d9-4eed-b702-cb3bd96f1c09",
    "creation_timestamp": "2021-05-12T11:18:03.886321765Z",
    "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-05-12T11:18:03.889409553Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 6e474f28-29f5-4832-9702-e968f98197cc

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-build672621555_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, 12 May 2021 11:18:03 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-aes-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "6e474f28-29f5-4832-9702-e968f98197cc",
    "creation_timestamp": "2021-05-12T11:18:03.889409553Z",
    "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-05-12T11:18:03.892281494Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 3ccc5ad6-23fc-41aa-9608-6a87cb17ebe5

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-build672621555_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, 12 May 2021 11:18:03 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-aes-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "3ccc5ad6-23fc-41aa-9608-6a87cb17ebe5",
    "creation_timestamp": "2021-05-12T11:18:03.892281494Z",
    "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-05-12T11:18:03.895212169Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 2ef23cda-d0b1-445c-9abf-21461950bc0b

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-build672621555_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, 12 May 2021 11:18:03 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-hmac-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "2ef23cda-d0b1-445c-9abf-21461950bc0b",
    "creation_timestamp": "2021-05-12T11:18:03.895212169Z",
    "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-05-12T11:18:03.897818893Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 9bf6942b-d198-4872-a0e3-95d53503f535

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-build672621555_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, 12 May 2021 11:18:03 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-hmac-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "9bf6942b-d198-4872-a0e3-95d53503f535",
    "creation_timestamp": "2021-05-12T11:18:03.897818893Z",
    "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
  }
}