Invocation Methods
To call a Key Management Service (KMS) API operation, send an HTTPS GET or POST request to an OpenAPI endpoint. Include the required request parameters as specified in the API documentation. After the operation is called, the system returns a response. Requests and responses are encoded in UTF-8.
Request structure
KMS API operations use the RPC protocol. You can call API operations by sending HTTPS GET or POST requests.
The request structure is as follows:
https://Endpoint/?Action=xx&Version=xx&Parameters
The following table describes the request parameters.
|
Parameter |
Description |
|
Endpoint |
The service endpoint. For more information, see Endpoints. |
|
Action |
The operation to perform. For example, call CreateKey to create a master key. |
|
Version |
The API version. The API version for KMS is 2016-01-20. |
|
Parameters |
Request parameters. Separate multiple parameters with ampersands (&). Request parameters consist of common and operation-specific parameters. Common parameters include the API version, identity verification information, and more. For more information, see Common parameters. |
Request example
The following example shows how to call the CreateKey operation to create a master key.
The sample request is formatted for readability.
https://kms.cn-hangzhou.aliyuncs.com/?Action=CreateKey
&Format=json
&Version=2016-01-20
&AccessKeyId=te****
&Signature=YlrFhyqDZQ1ThNYARrv3Ptaxqf****
&SignatureMethod=HMAC-SHA1
&Timestamp=2016-03-25T09:36:58Z
&SignatureVersion=1.0
…
Endpoints
kms.<RegionID>.cryptoservice.kms.aliyuncs.com,for exampleEast China 1 (Hangzhou):kms.cn-hangzhou.aliyuncs.com,kms-vpc.cn-hangzhou.aliyuncs.com。
Protocols
KMS supports only requests sent over HTTPS.
KMS supports only Transport Layer Security (TLS) 1.0 and later. It does not support SSL 2.0 or SSL 3.0.