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-08-25T09:03:15.648098802Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 604cee21-6389-4f23-8d91-c57e56c703f7

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-build970361017_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, 25 Aug 2021 09:03:15 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-rsa-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "604cee21-6389-4f23-8d91-c57e56c703f7",
    "creation_timestamp": "2021-08-25T09:03:15.648098802Z",
    "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-08-25T09:03:15.652595643Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 4b30c21e-98c9-4d49-944a-321366ec6fd1

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-build970361017_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, 25 Aug 2021 09:03:15 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-rsa-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "4b30c21e-98c9-4d49-944a-321366ec6fd1",
    "creation_timestamp": "2021-08-25T09:03:15.652595643Z",
    "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-08-25T09:03:15.655551024Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: bd392c4d-4133-4b12-9ebe-ef38e3a9be17

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-build970361017_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, 25 Aug 2021 09:03:15 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-aes-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "bd392c4d-4133-4b12-9ebe-ef38e3a9be17",
    "creation_timestamp": "2021-08-25T09:03:15.655551024Z",
    "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-08-25T09:03:15.659258289Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: b677f431-8207-44a5-9310-b5f2d6469af3

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-build970361017_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, 25 Aug 2021 09:03:15 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-aes-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "b677f431-8207-44a5-9310-b5f2d6469af3",
    "creation_timestamp": "2021-08-25T09:03:15.659258289Z",
    "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-08-25T09:03:15.662350740Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: ce28939d-790a-4973-b601-6c244a9811a5

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-build970361017_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, 25 Aug 2021 09:03:15 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-hmac-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "ce28939d-790a-4973-b601-6c244a9811a5",
    "creation_timestamp": "2021-08-25T09:03:15.662350740Z",
    "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-08-25T09:03:15.665543461Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 8833d628-f24b-4e68-aee8-4536ca06d444

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-build970361017_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, 25 Aug 2021 09:03:15 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-hmac-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "8833d628-f24b-4e68-aee8-4536ca06d444",
    "creation_timestamp": "2021-08-25T09:03:15.665543461Z",
    "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
  }
}