Converts a keyset of the BINARY type into a readable JSON string. After the conversion, you can view the details of the keyset.
Syntax
string KEYSET_TO_JSON(binary <keyset>,)
Parameters
keyset: required. A value of the BINARY type. This parameter specifies an existing keyset.
Return value
A keyset in the JSON format is returned. Parameter description:
key_id: the ID of the key.
key_material_origin: the origin of the key.
key_material_type: the encryption type of the key.
type: the algorithm type of the key.
value: the value of the key.
output_prefix_type: the format of the ciphertext after the encryption.
Examples
select KEYSET_TO_JSON(unhex ('0A1072384D715A414541385044643351534C12580A330A0B4145532D47434D2D323536122026A8FB1126DF4F5B5DD03C180E6919565D7716CBB291815EFB5BBF30F8BEF9AF1801200210011A1072384D715A414541385044643351534C20022A0B68656C6C6F20776F726C64')) ;
The following result is returned:
+------------+
| _c0 |
+------------+
| {
"key": [{
"description": "hello world",
"key_id": "r8MqZAEA8PDd3QSL",
"key_meta_data": {
"key_material_origin": "Origin_ALIYUN_MAXCOMPUTE",
"key_material_type": "SYMMETRIC",
"type": "AES-GCM-256",
"value": "Jqj7ESbfT1td0DwYDmkZVl13FsuykYFe+1u/MPi++a8="},
"output_prefix_type": "PREFIX_ALIYUN_MAXCOMPUTE",
"status": "ENABLED"}],
"primary_key_id": "r8MqZAEA8PDd3QSL"} |
+------------+
References
References | Description |
Describes how to use keyset-related encryption and decryption functions. | |
Describes the NEW_KEYSET function. The function is used to create a keyset based on a specified algorithm type. | |
Describes the ADD_KEY_TO_KEYSET function. The function is used to add a key to a keyset and configure the key as the master key. | |
Describes the KEYSET_FROM_JSON function. The function is used to convert a keyset of the JSON type into a keyset of the BINARY type. | |
Describes the ROTATE_KEYSET function. The function allows the system to automatically produce a new key and configure the new key as the master key. | |
Describes the NEW_WRAPPED_KEYSET function. The function is used to assume the Alibaba Cloud Resource Name (ARN) of a role that can use Key Management Service (KMS) customer master key (CMK) ARNs to MaxCompute and create a wrapped keyset. The role ARN is specified by | |
Describes the ROTATE_WRAPPED_KEYSET function. The function is used to decrypt an encrypted keyset, implement key rotation, and use a new key to encrypt data. | |
Describes the USE_WRAPPED_KEYSET function. The function is used to convert a wrapped keyset into a basic keyset that is used as a parameter in the encryption or decryption function. You can also use the USE_WRAPPED_KEYSET function to obtain information about a wrapped keyset and save the information for subsequent keyset maintenance. | |
Describes the ENHANCED_SYM_ENCRYPT function. The function is used to encrypt data by using a specified keyset. | |
Describes the ENHANCED_SYM_DECRYPT function. The function is used to decrypt data by using a specified keyset. |