All Products
Search
Document Center

Certificate Management Service:Sign

Last Updated:Jul 31, 2024

Signs a private certificate in a certificate application repository.

Operation description

You can call the Sign operation to sign a private certificate in a certificate application repository.

Limits

You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
MessagestringYes

The data to sign. The value must be encoded in Base64.
For example, if the hexadecimal data that you want to sign is [0x31, 0x32, 0x33, 0x34], set the parameter to the Base64-encoded value MTIzNA==. If you set MessageType to RAW, the size of the data must be less than 4 KB. If the size of the data is greater than 4 KB, you can set MessageType to DIGEST and set Message to the digest of the data. The digest is a hash value. You can compute the digest of the data on an on-premises machine. The certificate application repository uses the digest that you compute in your own certificate application system. The message digest algorithm that you use must match the specified signature algorithm. The following items describe the details:

  • If the signature algorithm is SHA256withRSA, SHA256withRSA/PSS, or SHA256withECDSA, the message digest algorithm must be SHA-256.
  • If the signature algorithm is SM3withSM2, the message digest algorithm must be SM3.
message
CertIdentifierstringYes

The unique identifier of the certificate. You can call the ListCert operation to obtain the identifier.

  • If the certificate is an SSL certificate, the value of this parameter must be in the {Certificate ID}-cn-hangzhou format.
  • If the certificate is a private certificate, the value of this parameter must be the value of the Identifier field for the private certificate.
ccaf0c629c2be1e2abb63bb76b
SigningAlgorithmstringYes

The signature algorithm. Valid values:

  • SHA256withRSA
  • SHA256withRSA/PSS
  • SHA256withECDSA
  • SM3withSM2
SHA256withRSA
MessageTypestringYes

The value type of the Message parameter. Valid values:

  • RAW: the raw data. This is the default value.
  • DIGEST: the message digest (hash value) of the raw data.
RAW

Response parameters

ParameterTypeDescriptionExample
object
Signaturestring

The signature.

eyaC0w3ROK5b3QcHmUtAhMY/sQjKu2t3uBfnf6J/gn7JfZtyxwcCUjzXbw5jmqJQRbj1te670Bshg9kUdanKhtHFhJjU5jX+ZMMBr6pH0gqQDJxR0K0yHXRc0Q5OQoUZ6BfpbI4Wt4jJvJSdCstz1vSg12CfEHS8Kd5qfhItK7Y=
RequestIdstring

The ID of the request.

1ed33293-2e48-6b14-861e-538e28e408eb

Examples

Sample success responses

JSONformat

{
  "Signature": "eyaC0w3ROK5b3QcHmUtAhMY/sQjKu2t3uBfnf6J/gn7JfZtyxwcCUjzXbw5jmqJQRbj1te670Bshg9kUdanKhtHFhJjU5jX+ZMMBr6pH0gqQDJxR0K0yHXRc0Q5OQoUZ6BfpbI4Wt4jJvJSdCstz1vSg12CfEHS8Kd5qfhItK7Y=",
  "RequestId": "1ed33293-2e48-6b14-861e-538e28e408eb"
}

Error codes

For a list of error codes, visit the Service error codes.