You need to enable JavaScript to run this app.
Key Management System

Key Management System

Copy page
Download PDF
Key management
AsymmetricSign - asymmetric key signature
Copy page
Download PDF
AsymmetricSign - asymmetric key signature

Asymmetric key signature

Debug

Request parameters

The table below only lists the unique request parameters of this API and some common parameters. See common parameters for more information.

parameter
type
Is required
Example value
Description
Action
String
yes

AsymmetricSign

The operation to perform, value: AsymmetricSign.

Version
String
yes

2021-02-18

API version, value: 2021-02-18.

KeyringName
String
No

keyring-test

Keyring name, length 2 to 31 characters. Valid characters: [a-zA-Z0-9-_]

KeyName
String
No

key-test

Primary key name, length 2 - 31 characters. Valid characters: [a-zA-Z0-9-_]

KeyID
String
No

39a0e7c6-b7dd-4c83-b400-3449bb95403a

Primary key ID, select one:
KeyringName and KeyName
KeyID

Message
String
Yes

MessageToBeSigned=

Signature message, Base64 encoded.
When MessageType is RAW: if raw signature data is specified, the corresponding hash algorithm in Algorithm will be used to generate a digest from the original message before signing. Value range: [1, 4096]
When MessageType is DIGEST:
And when Algorithm is RSA_PSS_SHA_256, RSA_PKCS1_SHA_256, ECDSA_SHA_256, or SM2_DSA, Message length is 32 bytes;
And when Algorithm is RSA_PSS_SHA_384, RSA_PKCS1_SHA_384, or ECDSA_SHA_384, Message length is 48 bytes;
And when Algorithm is RSA_PSS_SHA_512, RSA_PKCS1_SHA_512, or ECDSA_SHA_512, Message length is 64 bytes.

MessageType
String
No

RAW

message type, values:
RAW (default): raw data
DIGEST: message digest of raw data. KMS does not process the message digest of raw data and directly uses the private key for signing

Algorithm
String
yes

RSA_PSS_SHA_256

Signature algorithms, choose one from the following:
RSA_PSS_SHA_256
RSA_PKCS1_SHA_256
RSA_PSS_SHA_384
RSA_PKCS1_SHA_384
RSA_PSS_SHA_512
RSA_PKCS1_SHA_512
ECDSA_SHA_256
ECDSA_SHA_384
ECDSA_SHA_512
SM2_DSA
Mapping between signature algorithms and key types

Response parameters

The table below lists only the return parameters unique to this interface. For more information, see return structure.

Parameter
Type
Example Value
Description
KeyID
String

39a0e7c6-b7dd-4c83-b400-3449bb95403a

Primary key unique identifier, in UUID format

Signature
String

OuodVCE1zYpDFg1QvgOHtVQxkQWhfpE8i8NibiJ1pL8ILgAE+TogQZuIglAoo=

Data signature, Base64 encoded

Request example

POST /?Action=AsymmetricSign&Version=2021-02-18&KeyringName=demo&KeyName=demo&MessageType=RAW&Algorithm=RSA_PSS_SHA_256 HTTP/1.1 
Host: kms.cn-beijing.volcengineapi.com 
Content-Type: application/json; charset=UTF-8 
X-Date: 20240708T150011Z 
X-Content-Sha256: 287e874e******d653b44d21e 
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240708/cn-beijing/kms/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f 

{ 
  "Message": "MessageToBeSigned=" 
}

Return example

{ 
  "ResponseMetadata": { 
    "RequestId": "202407082300591051190940398C67B7", 
    "Action": "AsymmetricSign", 
    "Version": "2021-02-18", 
    "Service": "kms", 
    "Region": "cn-beijing" 
  }, 
  "Result": { 
    "KeyID": "39a0e7c6-b7dd-4c83-b400-3449bb95403a", 
    "Signature": "OuodVCE1zYpDFg1QvgOHtVQxkQWhfpE8i8NibiJ1pL8ILgAE+TogQZuIglAoo=" 
  } 
}

Error Code

The following table lists the error codes related to this interface and business logic. Refer to the Public Error Codes document for common error codes.

Status Code
Error Code
Error Message
Description
400
MissingParameter

The request is missing %s parameter.

400
InvalidParameter

The request parameter %s is invalid.

400
InvalidKeyStatus

Current key status: %s does not allow to perform this action

400
InvalidKeyUsage

Current key usage only allows: %s. Please use different keys for encryption/decryption and signing/verification.

403
AccessDenied

User is not authorized to do this action

403
Reject.Throttling.CMK

The request of CMK: %s upper limit is exceeded.

403
KeyMaterialExpire

Key expire in, %s

404
Not Found

Not found %s [%s].

500
UndefinedError

Undefined Internal Error. Pls Contact With Admin.

Last updated: 2025.06.27 15:24:17