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 kms_key.yaml has following contents (kms_key.CreateRequest):

RequestJSON:

{
    "metadata": {
        "name": "kms-rsa-key-default",
        "namespace": "documentation"
    },
    "spec": {
        "key_info": {
            "rsa_key": {}
        }
    }
}

vesctl yaml response:

ResponseJSON:

{
    "metadata": {
        "name": "kms-rsa-key-default",
        "namespace": "documentation",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "42d4e3ba-e5f1-445c-970a-9e9c0827b309",
        "creation_timestamp": "2022-09-23T13:12:45.171690172Z",
        "deletion_timestamp": null,
        "modification_timestamp": null,
        "initializers": null,
        "finalizers": [],
        "tenant": "acmecorp",
        "creator_class": "examplesvc",
        "creator_id": "examplesvc",
        "object_index": 0,
        "owner_view": null,
        "labels": {}
    },
    "spec": {
        "sensitivity": "SENSITIVITY_MEDIUM",
        "policies": [],
        "max_cache_age": null
    }
}

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-rsa-key-default","namespace":"documentation"},"spec":{"key_info":{"rsa_key":{}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_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: 718
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:12:45 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-rsa-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "42d4e3ba-e5f1-445c-970a-9e9c0827b309",
    "creation_timestamp": "2022-09-23T13:12:45.171690172Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "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 kms_key.yaml has following contents (kms_key.CreateRequest):

RequestJSON:

{
    "metadata": {
        "name": "kms-rsa-key-with-params",
        "namespace": "documentation"
    },
    "spec": {
        "sensitivity": "SENSITIVITY_LOW",
        "key_info": {
            "rsa_key": {
                "params": {
                    "key_size": 2048,
                    "ES_schemes": [
                        "RSAES_OAEP",
                        "RSAES_PKCS1_V15"
                    ],
                    "SSA_schemes": [
                        "RSASSA_PKCS1_V15",
                        "RSASSA_PSS"
                    ],
                    "hash_algos": [
                        "SHA256"
                    ]
                }
            }
        }
    }
}

vesctl yaml response:

ResponseJSON:

{
    "metadata": {
        "name": "kms-rsa-key-with-params",
        "namespace": "documentation",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "f99fe5f7-fc52-4900-a336-3f27aa640fa6",
        "creation_timestamp": "2022-09-23T13:12:45.175003076Z",
        "deletion_timestamp": null,
        "modification_timestamp": null,
        "initializers": null,
        "finalizers": [],
        "tenant": "acmecorp",
        "creator_class": "examplesvc",
        "creator_id": "examplesvc",
        "object_index": 0,
        "owner_view": null,
        "labels": {}
    },
    "spec": {
        "sensitivity": "SENSITIVITY_LOW",
        "policies": [],
        "max_cache_age": null
    }
}

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-rsa-key-with-params","namespace":"documentation"},"spec":{"sensitivity":"SENSITIVITY_LOW","key_info":{"rsa_key":{"params":{"key_size":2048,"ES_schemes":["RSAES_OAEP","RSAES_PKCS1_V15"],"SSA_schemes":["RSASSA_PKCS1_V15","RSASSA_PSS"],"hash_algos":["SHA256"]}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_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: 719
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:12:45 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-rsa-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "f99fe5f7-fc52-4900-a336-3f27aa640fa6",
    "creation_timestamp": "2022-09-23T13:12:45.175003076Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "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 kms_key.yaml has following contents (kms_key.CreateRequest):

RequestJSON:

{
    "metadata": {
        "name": "kms-aes-key-default",
        "namespace": "documentation"
    },
    "spec": {
        "key_info": {
            "aes_key": {}
        }
    }
}

vesctl yaml response:

ResponseJSON:

{
    "metadata": {
        "name": "kms-aes-key-default",
        "namespace": "documentation",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "96929a87-aa87-40da-a09d-96cde3c7df89",
        "creation_timestamp": "2022-09-23T13:12:45.177718139Z",
        "deletion_timestamp": null,
        "modification_timestamp": null,
        "initializers": null,
        "finalizers": [],
        "tenant": "acmecorp",
        "creator_class": "examplesvc",
        "creator_id": "examplesvc",
        "object_index": 0,
        "owner_view": null,
        "labels": {}
    },
    "spec": {
        "sensitivity": "SENSITIVITY_MEDIUM",
        "policies": [],
        "max_cache_age": null
    }
}

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-aes-key-default","namespace":"documentation"},"spec":{"key_info":{"aes_key":{}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_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: 718
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:12:45 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-aes-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "96929a87-aa87-40da-a09d-96cde3c7df89",
    "creation_timestamp": "2022-09-23T13:12:45.177718139Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "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 kms_key.yaml has following contents (kms_key.CreateRequest):

RequestJSON:

{
    "metadata": {
        "name": "kms-aes-key-with-params",
        "namespace": "documentation"
    },
    "spec": {
        "sensitivity": "SENSITIVITY_LOW",
        "key_info": {
            "aes_key": {
                "params": {
                    "key_size": 256,
                    "nonce_size_min": 96,
                    "nonce_size_max": 256
                }
            }
        }
    }
}

vesctl yaml response:

ResponseJSON:

{
    "metadata": {
        "name": "kms-aes-key-with-params",
        "namespace": "documentation",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "bdfd8c69-5b30-43d7-bc2f-435f310d9243",
        "creation_timestamp": "2022-09-23T13:12:45.180508976Z",
        "deletion_timestamp": null,
        "modification_timestamp": null,
        "initializers": null,
        "finalizers": [],
        "tenant": "acmecorp",
        "creator_class": "examplesvc",
        "creator_id": "examplesvc",
        "object_index": 0,
        "owner_view": null,
        "labels": {}
    },
    "spec": {
        "sensitivity": "SENSITIVITY_LOW",
        "policies": [],
        "max_cache_age": null
    }
}

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-aes-key-with-params","namespace":"documentation"},"spec":{"sensitivity":"SENSITIVITY_LOW","key_info":{"aes_key":{"params":{"key_size":256,"nonce_size_min":96,"nonce_size_max":256}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_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: 719
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:12:45 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-aes-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "bdfd8c69-5b30-43d7-bc2f-435f310d9243",
    "creation_timestamp": "2022-09-23T13:12:45.180508976Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "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 kms_key.yaml has following contents (kms_key.CreateRequest):

RequestJSON:

{
    "metadata": {
        "name": "kms-hmac-key-default",
        "namespace": "documentation"
    },
    "spec": {
        "key_info": {
            "hmac_key": {}
        }
    }
}

vesctl yaml response:

ResponseJSON:

{
    "metadata": {
        "name": "kms-hmac-key-default",
        "namespace": "documentation",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "9274e456-2416-4285-af10-f34993f1db10",
        "creation_timestamp": "2022-09-23T13:12:45.183322168Z",
        "deletion_timestamp": null,
        "modification_timestamp": null,
        "initializers": null,
        "finalizers": [],
        "tenant": "acmecorp",
        "creator_class": "examplesvc",
        "creator_id": "examplesvc",
        "object_index": 0,
        "owner_view": null,
        "labels": {}
    },
    "spec": {
        "sensitivity": "SENSITIVITY_MEDIUM",
        "policies": [],
        "max_cache_age": null
    }
}

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-hmac-key-default","namespace":"documentation"},"spec":{"key_info":{"hmac_key":{}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_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: 719
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:12:45 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-hmac-key-default",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "9274e456-2416-4285-af10-f34993f1db10",
    "creation_timestamp": "2022-09-23T13:12:45.183322168Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "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 kms_key.yaml has following contents (kms_key.CreateRequest):

RequestJSON:

{
    "metadata": {
        "name": "kms-hmac-key-with-params",
        "namespace": "documentation"
    },
    "spec": {
        "sensitivity": "SENSITIVITY_LOW",
        "key_info": {
            "hmac_key": {
                "params": {
                    "key_size": 256,
                    "algo_list": [
                        "SHA256"
                    ]
                }
            }
        }
    }
}

vesctl yaml response:

ResponseJSON:

{
    "metadata": {
        "name": "kms-hmac-key-with-params",
        "namespace": "documentation",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "9a573043-1d2a-49bd-af51-4d138c0ff9a9",
        "creation_timestamp": "2022-09-23T13:12:45.186101063Z",
        "deletion_timestamp": null,
        "modification_timestamp": null,
        "initializers": null,
        "finalizers": [],
        "tenant": "acmecorp",
        "creator_class": "examplesvc",
        "creator_id": "examplesvc",
        "object_index": 0,
        "owner_view": null,
        "labels": {}
    },
    "spec": {
        "sensitivity": "SENSITIVITY_LOW",
        "policies": [],
        "max_cache_age": null
    }
}

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-hmac-key-with-params","namespace":"documentation"},"spec":{"sensitivity":"SENSITIVITY_LOW","key_info":{"hmac_key":{"params":{"key_size":256,"algo_list":["SHA256"]}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_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: 720
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:12:45 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-hmac-key-with-params",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "9a573043-1d2a-49bd-af51-4d138c0ff9a9",
    "creation_timestamp": "2022-09-23T13:12:45.186101063Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "spec": {
    "sensitivity": "SENSITIVITY_LOW",
    "policies": [
    ],
    "max_cache_age": null
  }
}