Congirue request
    • PDF

    Congirue request

    • PDF

    Article summary

    To call the KMS Rest API 1.0, you must perform API Gateway and Sub Account authentications.
    For API calls using API Gateway, see API Gateway Manual (formerly, user guide). An API request message consists of the following.

    Request configuration

    Dedicated headers

    x-ncp-apigw-timestamp
    x-ncp-iam-access-key
    x-ncp-apigw-signature-v1 or x-ncp-apigw-signature-v2

    API Gateway request signature v1 request example

    Header
      x-ncp-apigw-timestamp:{Timestamp}
      x-ncp-apigw-api-key:{API Gateway API Key}
      x-ncp-iam-access-key:{Sub Account Access Key}
      x-ncp-apigw-signature-v1:{API Gateway Signature}
      Content-Type:application/json
    Body
      fieldName: {Base64 Encoded message}
    URL
      https://kms.apigw.ntruss.com/keys/v1/{keyTag}/{action}
    

    API Gateway request signature v2 request example

    Header
      x-ncp-apigw-timestamp:{Timestamp}
      x-ncp-iam-access-key:{Sub Account Access Key}
      x-ncp-apigw-signature-v2:{API Gateway Signature}
      Content-Type:application/json
    Body
      fieldName: {Base64 Encoded message}
    URL
      https://kms.apigw.ntruss.com/keys/v2/{keyTag}/{action}
    

    Response format

    The data encrypted with the master key and returned consists of "KMS prefix + ciphertext." The KMS prefix consists of [ncpkms:version information], which is required for decryption, so arbitrary removal or manipulation is prohibited. If the KMS prefix is incorrect, it will not be decrypted correctly. It is recommended to keep it in the returned form.

     ncpkms:v1:XjsPWPjqPrBi1N2DupSiSbX/ATkGmKA
     --------- -------------------------------
    KMS prefix        ciphertext
    

    Response example

    {
      "code": "SUCCESS",
      "msg": "",
      "data":{
        "ciphertext": "ncpkms:v1:gsYccPMkd/fAtqbKuj2ov4H+EdZC8Qb/b1GPIIN2Z61+yULo"
      }
    }
    

    Errors

    Response codeResponse message
    FORBIDDEN"Forbidden"
    INTERNAL_SERVER_ERROR"Server internal error"
    UNPROCESSABLE_ENTITY"Invalid status"
    INVALID_REQUEST"Invalid request"
    UNAUTHORIZED"Unauthorized"
    NOT_FOUND"Not found"
    INVALID_STATUS"Invalid status"

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.