tencentcloud-sdk-nodejs-intl-en
Version:
1,994 lines (1,661 loc) • 120 kB
JavaScript
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
const AbstractModel = require("../../common/abstract_model");
/**
* UpdateAlias request structure.
* @class
*/
class UpdateAliasRequest extends AbstractModel {
constructor(){
super();
/**
* New alias containing 1-60 characters or digits
* @type {string || null}
*/
this.Alias = null;
/**
* Globally unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.Alias = 'Alias' in params ? params.Alias : null;
this.KeyId = 'KeyId' in params ? params.KeyId : null;
}
}
/**
* EnableWhiteBoxKey request structure.
* @class
*/
class EnableWhiteBoxKeyRequest extends AbstractModel {
constructor(){
super();
/**
* Globally unique white-box key ID
* @type {string || null}
*/
this.KeyId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
}
}
/**
* AsymmetricRsaDecrypt request structure.
* @class
*/
class AsymmetricRsaDecryptRequest extends AbstractModel {
constructor(){
super();
/**
* Unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
/**
* Base64-encoded ciphertext encrypted with `PublicKey`
* @type {string || null}
*/
this.Ciphertext = null;
/**
* Corresponding algorithm when a public key is used for encryption. Valid values: RSAES_PKCS1_V1_5, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
* @type {string || null}
*/
this.Algorithm = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.Ciphertext = 'Ciphertext' in params ? params.Ciphertext : null;
this.Algorithm = 'Algorithm' in params ? params.Algorithm : null;
}
}
/**
* EnableKeyRotation request structure.
* @class
*/
class EnableKeyRotationRequest extends AbstractModel {
constructor(){
super();
/**
* Unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
/**
* The interval between each key rotation in days. Value range: 7 - 365 (default).
* @type {number || null}
*/
this.RotateDays = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.RotateDays = 'RotateDays' in params ? params.RotateDays : null;
}
}
/**
* DescribeWhiteBoxKeyDetails response structure.
* @class
*/
class DescribeWhiteBoxKeyDetailsResponse extends AbstractModel {
constructor(){
super();
/**
* White-box key information list
* @type {Array.<WhiteboxKeyInfo> || null}
*/
this.KeyInfos = null;
/**
* Total white-box keys.
Note: This field may return null, indicating that no valid values can be obtained.
* @type {number || null}
*/
this.TotalCount = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
if (params.KeyInfos) {
this.KeyInfos = new Array();
for (let z in params.KeyInfos) {
let obj = new WhiteboxKeyInfo();
obj.deserialize(params.KeyInfos[z]);
this.KeyInfos.push(obj);
}
}
this.TotalCount = 'TotalCount' in params ? params.TotalCount : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* CreateKey request structure.
* @class
*/
class CreateKeyRequest extends AbstractModel {
constructor(){
super();
/**
* Unique alias that makes a key more recognizable and understandable. This parameter cannot be empty, can contain 1-60 letters, digits, `-`, and `_`, and must begin with a letter or digit. The `kms-` prefix is used for Tencent Cloud products.
* @type {string || null}
*/
this.Alias = null;
/**
* CMK description of up to 1,024 bytes in length
* @type {string || null}
*/
this.Description = null;
/**
* Defines the purpose of the key. The valid values are as follows: `ENCRYPT_DECRYPT` (default): creates a symmetric encryption/decryption key; `ASYMMETRIC_DECRYPT_RSA_2048`: creates an asymmetric encryption/decryption 2048-bit RSA key; `ASYMMETRIC_DECRYPT_SM2`: creates an asymmetric encryption/decryption SM2 key; `ASYMMETRIC_SIGN_VERIFY_SM2`: creates an asymmetric SM2 key for signature verification; `ASYMMETRIC_SIGN_VERIFY_ECC`: creates an asymmetric 2048-bit RSA key for signature verification; `ASYMMETRIC_SIGN_VERIFY_ECDSA384`: creates an asymmetric ECDSA384 key for signature verification. You can get a full list of supported key purposes and algorithms using the ListAlgorithms API.
* @type {string || null}
*/
this.KeyUsage = null;
/**
* Specifies the key type. Default value: 1. Valid value: 1 - default type, indicating that the CMK is created by KMS; 2 - EXTERNAL type, indicating that you need to import key material. For more information, please see the `GetParametersForImport` and `ImportKeyMaterial` API documents.
* @type {number || null}
*/
this.Type = null;
/**
* Tag list
* @type {Array.<Tag> || null}
*/
this.Tags = null;
/**
* ID of the HSM cluster. This field is only valid for Exclusive and Managed KMS instances.
* @type {string || null}
*/
this.HsmClusterId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.Alias = 'Alias' in params ? params.Alias : null;
this.Description = 'Description' in params ? params.Description : null;
this.KeyUsage = 'KeyUsage' in params ? params.KeyUsage : null;
this.Type = 'Type' in params ? params.Type : null;
if (params.Tags) {
this.Tags = new Array();
for (let z in params.Tags) {
let obj = new Tag();
obj.deserialize(params.Tags[z]);
this.Tags.push(obj);
}
}
this.HsmClusterId = 'HsmClusterId' in params ? params.HsmClusterId : null;
}
}
/**
* DisableWhiteBoxKey response structure.
* @class
*/
class DisableWhiteBoxKeyResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DisableKey response structure.
* @class
*/
class DisableKeyResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DescribeWhiteBoxServiceStatus request structure.
* @class
*/
class DescribeWhiteBoxServiceStatusRequest extends AbstractModel {
constructor(){
super();
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
}
}
/**
* VerifyByAsymmetricKey request structure.
* @class
*/
class VerifyByAsymmetricKeyRequest extends AbstractModel {
constructor(){
super();
/**
* Unique ID of a key
* @type {string || null}
*/
this.KeyId = null;
/**
* Signature value, which is generated by calling the KMS signature API.
* @type {string || null}
*/
this.SignatureValue = null;
/**
* Full message or message abstract. Before Base64 encoding, an original message can contain up to 4,096 bytes while a message abstract must be 32 bytes.
* @type {string || null}
*/
this.Message = null;
/**
* Signature algorithm. The valid values include `SM2DSA`, `ECC_P256_R1`, `RSA_PSS_SHA_256`, and `RSA_PKCS1_SHA_256`, etc. You can get a full list of supported algorithms using the ListAlgorithms API.
* @type {string || null}
*/
this.Algorithm = null;
/**
* Message type. Valid values: `RAW` (indicating an original message; used by default if the parameter is not passed in) and `DIGEST`.
* @type {string || null}
*/
this.MessageType = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.SignatureValue = 'SignatureValue' in params ? params.SignatureValue : null;
this.Message = 'Message' in params ? params.Message : null;
this.Algorithm = 'Algorithm' in params ? params.Algorithm : null;
this.MessageType = 'MessageType' in params ? params.MessageType : null;
}
}
/**
* DescribeKey request structure.
* @class
*/
class DescribeKeyRequest extends AbstractModel {
constructor(){
super();
/**
* Globally unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
}
}
/**
* White-box key information
* @class
*/
class WhiteboxKeyInfo extends AbstractModel {
constructor(){
super();
/**
* Globally unique white-box key ID
* @type {string || null}
*/
this.KeyId = null;
/**
* Unique alias that makes a key more recognizable and understandable. This parameter cannot be empty, can contain 1 to 60 letters, digits, hyphens (-), and underscores (_), and must begin with a letter or digit.
* @type {string || null}
*/
this.Alias = null;
/**
* Creator
* @type {number || null}
*/
this.CreatorUin = null;
/**
* Key description information
* @type {string || null}
*/
this.Description = null;
/**
* Key creation time in Unix timestamp
* @type {number || null}
*/
this.CreateTime = null;
/**
* White-box key status. Valid values: Enabled, Disabled
* @type {string || null}
*/
this.Status = null;
/**
* Creator
* @type {number || null}
*/
this.OwnerUin = null;
/**
* Key algorithm type
* @type {string || null}
*/
this.Algorithm = null;
/**
* Base64-encoded white-box encryption key
* @type {string || null}
*/
this.EncryptKey = null;
/**
* Base64-encoded white-box decryption key
* @type {string || null}
*/
this.DecryptKey = null;
/**
* Resource ID in the format of `creatorUin/$creatorUin/$keyId`
* @type {string || null}
*/
this.ResourceId = null;
/**
* Whether there is a device fingerprint bound to the current key
Note: this field may return null, indicating that no valid values can be obtained.
* @type {boolean || null}
*/
this.DeviceFingerprintBind = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.Alias = 'Alias' in params ? params.Alias : null;
this.CreatorUin = 'CreatorUin' in params ? params.CreatorUin : null;
this.Description = 'Description' in params ? params.Description : null;
this.CreateTime = 'CreateTime' in params ? params.CreateTime : null;
this.Status = 'Status' in params ? params.Status : null;
this.OwnerUin = 'OwnerUin' in params ? params.OwnerUin : null;
this.Algorithm = 'Algorithm' in params ? params.Algorithm : null;
this.EncryptKey = 'EncryptKey' in params ? params.EncryptKey : null;
this.DecryptKey = 'DecryptKey' in params ? params.DecryptKey : null;
this.ResourceId = 'ResourceId' in params ? params.ResourceId : null;
this.DeviceFingerprintBind = 'DeviceFingerprintBind' in params ? params.DeviceFingerprintBind : null;
}
}
/**
* ListAlgorithms response structure.
* @class
*/
class ListAlgorithmsResponse extends AbstractModel {
constructor(){
super();
/**
* Symmetric encryption algorithms supported in this region
* @type {Array.<AlgorithmInfo> || null}
*/
this.SymmetricAlgorithms = null;
/**
* Asymmetric encryption algorithms supported in this region
* @type {Array.<AlgorithmInfo> || null}
*/
this.AsymmetricAlgorithms = null;
/**
* Asymmetric signature verification algorithms supported in the current region
* @type {Array.<AlgorithmInfo> || null}
*/
this.AsymmetricSignVerifyAlgorithms = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
if (params.SymmetricAlgorithms) {
this.SymmetricAlgorithms = new Array();
for (let z in params.SymmetricAlgorithms) {
let obj = new AlgorithmInfo();
obj.deserialize(params.SymmetricAlgorithms[z]);
this.SymmetricAlgorithms.push(obj);
}
}
if (params.AsymmetricAlgorithms) {
this.AsymmetricAlgorithms = new Array();
for (let z in params.AsymmetricAlgorithms) {
let obj = new AlgorithmInfo();
obj.deserialize(params.AsymmetricAlgorithms[z]);
this.AsymmetricAlgorithms.push(obj);
}
}
if (params.AsymmetricSignVerifyAlgorithms) {
this.AsymmetricSignVerifyAlgorithms = new Array();
for (let z in params.AsymmetricSignVerifyAlgorithms) {
let obj = new AlgorithmInfo();
obj.deserialize(params.AsymmetricSignVerifyAlgorithms[z]);
this.AsymmetricSignVerifyAlgorithms.push(obj);
}
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DisableKeys response structure.
* @class
*/
class DisableKeysResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DescribeWhiteBoxKey response structure.
* @class
*/
class DescribeWhiteBoxKeyResponse extends AbstractModel {
constructor(){
super();
/**
* White-box key information
* @type {WhiteboxKeyInfo || null}
*/
this.KeyInfo = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
if (params.KeyInfo) {
let obj = new WhiteboxKeyInfo();
obj.deserialize(params.KeyInfo)
this.KeyInfo = obj;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* UpdateKeyDescription response structure.
* @class
*/
class UpdateKeyDescriptionResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DescribeWhiteBoxServiceStatus response structure.
* @class
*/
class DescribeWhiteBoxServiceStatusResponse extends AbstractModel {
constructor(){
super();
/**
* Whether the user's white-box key service is available
* @type {boolean || null}
*/
this.ServiceEnabled = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.ServiceEnabled = 'ServiceEnabled' in params ? params.ServiceEnabled : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* ImportKeyMaterial request structure.
* @class
*/
class ImportKeyMaterialRequest extends AbstractModel {
constructor(){
super();
/**
* Base64-encoded key material that encrypted with the `PublicKey` returned by `GetParametersForImport`. For the KMS of SM-CRYPTO version, the length of the key material should be 128 bits, while for KMS of FIPS-compliant version, the length should be 256 bits.
* @type {string || null}
*/
this.EncryptedKeyMaterial = null;
/**
* Import token obtained by calling `GetParametersForImport`.
* @type {string || null}
*/
this.ImportToken = null;
/**
* Specifies the CMK into which to import key material, which must be the same as the one specified by `GetParametersForImport`.
* @type {string || null}
*/
this.KeyId = null;
/**
* Unix timestamp of the key material's expiration time. If this value is empty or 0, the key material will never expire. To specify the expiration time, it should be later than the current time. Maximum value: 2147443200.
* @type {number || null}
*/
this.ValidTo = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.EncryptedKeyMaterial = 'EncryptedKeyMaterial' in params ? params.EncryptedKeyMaterial : null;
this.ImportToken = 'ImportToken' in params ? params.ImportToken : null;
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.ValidTo = 'ValidTo' in params ? params.ValidTo : null;
}
}
/**
* EnableKey request structure.
* @class
*/
class EnableKeyRequest extends AbstractModel {
constructor(){
super();
/**
* Unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
}
}
/**
* GetKeyRotationStatus request structure.
* @class
*/
class GetKeyRotationStatusRequest extends AbstractModel {
constructor(){
super();
/**
* Unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
}
}
/**
* ListAlgorithms request structure.
* @class
*/
class ListAlgorithmsRequest extends AbstractModel {
constructor(){
super();
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
}
}
/**
* Tag key and tag value
* @class
*/
class Tag extends AbstractModel {
constructor(){
super();
/**
* Tag key
* @type {string || null}
*/
this.TagKey = null;
/**
* Tag value
* @type {string || null}
*/
this.TagValue = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.TagKey = 'TagKey' in params ? params.TagKey : null;
this.TagValue = 'TagValue' in params ? params.TagValue : null;
}
}
/**
* ListKeyDetail response structure.
* @class
*/
class ListKeyDetailResponse extends AbstractModel {
constructor(){
super();
/**
* Total number of CMKs
* @type {number || null}
*/
this.TotalCount = null;
/**
* List of returned attribute information.
Note: this field may return null, indicating that no valid values can be obtained.
* @type {Array.<KeyMetadata> || null}
*/
this.KeyMetadatas = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.TotalCount = 'TotalCount' in params ? params.TotalCount : null;
if (params.KeyMetadatas) {
this.KeyMetadatas = new Array();
for (let z in params.KeyMetadatas) {
let obj = new KeyMetadata();
obj.deserialize(params.KeyMetadatas[z]);
this.KeyMetadatas.push(obj);
}
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* GenerateDataKey request structure.
* @class
*/
class GenerateDataKeyRequest extends AbstractModel {
constructor(){
super();
/**
* Globally unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
/**
* Specifies the encryption algorithm and size of the `DataKey`. Valid values: AES_128, AES_256. Either `KeySpec` or `NumberOfBytes` must be specified.
* @type {string || null}
*/
this.KeySpec = null;
/**
* Length of the `DataKey`. If both `NumberOfBytes` and `KeySpec` are specified, `NumberOfBytes` will prevail. Minimum value: 1; maximum value: 1024. Either `KeySpec` or `NumberOfBytes` must be specified.
* @type {number || null}
*/
this.NumberOfBytes = null;
/**
* JSON string of key-value pair. If this field is used, the same string should be entered when the returned `DataKey` is decrypted.
* @type {string || null}
*/
this.EncryptionContext = null;
/**
* PEM-encoded public key (2048-bit RSA/SM2 key), which can be used to encrypt the `Plaintext` returned. If this field is left empty, the `Plaintext` will not be encrypted.
* @type {string || null}
*/
this.EncryptionPublicKey = null;
/**
* Asymmetric encryption algorithm. Valid values: `SM2` (C1C3C2 ciphertext is returned)`, `SM2_C1C3C2_ASN1` (C1C3C2 ASN1 ciphertext is returned), `RSAES_PKCS1_V1_5`, `RSAES_OAEP_SHA_1`, and `RSAES_OAEP_SHA_256`. This field is used in combination with `EncryptionPublicKey` for encryption. If it is left empty, an SM2 public key will be used by default.
* @type {string || null}
*/
this.EncryptionAlgorithm = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.KeySpec = 'KeySpec' in params ? params.KeySpec : null;
this.NumberOfBytes = 'NumberOfBytes' in params ? params.NumberOfBytes : null;
this.EncryptionContext = 'EncryptionContext' in params ? params.EncryptionContext : null;
this.EncryptionPublicKey = 'EncryptionPublicKey' in params ? params.EncryptionPublicKey : null;
this.EncryptionAlgorithm = 'EncryptionAlgorithm' in params ? params.EncryptionAlgorithm : null;
}
}
/**
* UpdateAlias response structure.
* @class
*/
class UpdateAliasResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* ScheduleKeyDeletion response structure.
* @class
*/
class ScheduleKeyDeletionResponse extends AbstractModel {
constructor(){
super();
/**
* Schedule deletion execution time
* @type {number || null}
*/
this.DeletionDate = null;
/**
* Unique ID of the CMK scheduled for deletion
* @type {string || null}
*/
this.KeyId = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.DeletionDate = 'DeletionDate' in params ? params.DeletionDate : null;
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* PostQuantumCryptoVerify request structure.
* @class
*/
class PostQuantumCryptoVerifyRequest extends AbstractModel {
constructor(){
super();
/**
* Unique ID of a key
* @type {string || null}
*/
this.KeyId = null;
/**
* Signature value, which is generated by calling the `PostQuantumCryptoSign` API.
* @type {string || null}
*/
this.SignatureValue = null;
/**
* Original message text before Base64 encoding. It cannot exceed 4096 bytes.
* @type {string || null}
*/
this.Message = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.SignatureValue = 'SignatureValue' in params ? params.SignatureValue : null;
this.Message = 'Message' in params ? params.Message : null;
}
}
/**
* GenerateRandom response structure.
* @class
*/
class GenerateRandomResponse extends AbstractModel {
constructor(){
super();
/**
* Base64-encoded plaintext of the randomly generated number. You need to Base64-decode it to get the plaintext.
* @type {string || null}
*/
this.Plaintext = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.Plaintext = 'Plaintext' in params ? params.Plaintext : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DescribeKeys request structure.
* @class
*/
class DescribeKeysRequest extends AbstractModel {
constructor(){
super();
/**
* List of IDs of the CMKs to be queried in batches. Up to 100 `KeyId` values are supported in one query.
* @type {Array.<string> || null}
*/
this.KeyIds = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyIds = 'KeyIds' in params ? params.KeyIds : null;
}
}
/**
* GetPublicKey request structure.
* @class
*/
class GetPublicKeyRequest extends AbstractModel {
constructor(){
super();
/**
* Unique CMK ID.
* @type {string || null}
*/
this.KeyId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
}
}
/**
* GetServiceStatus request structure.
* @class
*/
class GetServiceStatusRequest extends AbstractModel {
constructor(){
super();
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
}
}
/**
* EnableWhiteBoxKeys response structure.
* @class
*/
class EnableWhiteBoxKeysResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* ArchiveKey response structure.
* @class
*/
class ArchiveKeyResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* VerifyByAsymmetricKey response structure.
* @class
*/
class VerifyByAsymmetricKeyResponse extends AbstractModel {
constructor(){
super();
/**
* Whether the signature is valid. `true`: the signature is valid; `false`: the signature is invalid.
* @type {boolean || null}
*/
this.SignatureValid = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.SignatureValid = 'SignatureValid' in params ? params.SignatureValid : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DescribeWhiteBoxKey request structure.
* @class
*/
class DescribeWhiteBoxKeyRequest extends AbstractModel {
constructor(){
super();
/**
* Globally unique white-box key ID
* @type {string || null}
*/
this.KeyId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
}
}
/**
* GetParametersForImport response structure.
* @class
*/
class GetParametersForImportResponse extends AbstractModel {
constructor(){
super();
/**
* Unique ID of a CMK, which is used to specify the CMK into which to import key material.
* @type {string || null}
*/
this.KeyId = null;
/**
* The token required for importing key material, which is used as a parameter for `ImportKeyMaterial`.
* @type {string || null}
*/
this.ImportToken = null;
/**
* The Base64-encoded RSA public key used to encrypt key material before importing it with `ImportKeyMaterial`.
* @type {string || null}
*/
this.PublicKey = null;
/**
* Validity period of the token and public key. A token and public key can only be imported when they are valid. If they are expired, you will need to call the `GetParametersForImport` API again to get a new token and public key.
* @type {number || null}
*/
this.ParametersValidTo = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.ImportToken = 'ImportToken' in params ? params.ImportToken : null;
this.PublicKey = 'PublicKey' in params ? params.PublicKey : null;
this.ParametersValidTo = 'ParametersValidTo' in params ? params.ParametersValidTo : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* Decrypt response structure.
* @class
*/
class DecryptResponse extends AbstractModel {
constructor(){
super();
/**
* Globally unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
/**
* If `EncryptionPublicKey` is left empty, a Base64-encoded ciphertext will be returned. To get the plaintext, you need to decode the ciphertext first.
If `EncryptionPublicKey` is specified, this field will return the Base64-encoded ciphertext encrypted with the specified public key. To get the plaintext, you need to decode the ciphertext and upload the corresponding private key.
* @type {string || null}
*/
this.Plaintext = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.Plaintext = 'Plaintext' in params ? params.Plaintext : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* CreateWhiteBoxKey response structure.
* @class
*/
class CreateWhiteBoxKeyResponse extends AbstractModel {
constructor(){
super();
/**
* Base64-encoded encryption key
* @type {string || null}
*/
this.EncryptKey = null;
/**
* Base64-encoded decryption key
* @type {string || null}
*/
this.DecryptKey = null;
/**
* Globally unique white-box key ID
* @type {string || null}
*/
this.KeyId = null;
/**
* Tag operation return code. 0: success; 1: internal error; 2: business processing error
* @type {number || null}
*/
this.TagCode = null;
/**
* Tag operation return message
* @type {string || null}
*/
this.TagMsg = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.EncryptKey = 'EncryptKey' in params ? params.EncryptKey : null;
this.DecryptKey = 'DecryptKey' in params ? params.DecryptKey : null;
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.TagCode = 'TagCode' in params ? params.TagCode : null;
this.TagMsg = 'TagMsg' in params ? params.TagMsg : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* Returned CMK list information
* @class
*/
class Key extends AbstractModel {
constructor(){
super();
/**
* Globally unique CMK ID.
* @type {string || null}
*/
this.KeyId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
}
}
/**
* DeleteImportedKeyMaterial response structure.
* @class
*/
class DeleteImportedKeyMaterialResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* EnableKeys request structure.
* @class
*/
class EnableKeysRequest extends AbstractModel {
constructor(){
super();
/**
* List of IDs of the CMKs to be enabled in batches. Up to 100 CMKs are supported at a time
* @type {Array.<string> || null}
*/
this.KeyIds = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyIds = 'KeyIds' in params ? params.KeyIds : null;
}
}
/**
* EnableWhiteBoxKeys request structure.
* @class
*/
class EnableWhiteBoxKeysRequest extends AbstractModel {
constructor(){
super();
/**
* List of globally unique white-box key IDs. Note: you should make sure that all provided `KeyId` values are in valid format, unique, and actually exist. Up to 50 ones are allowed.
* @type {Array.<string> || null}
*/
this.KeyIds = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyIds = 'KeyIds' in params ? params.KeyIds : null;
}
}
/**
* EncryptByWhiteBox response structure.
* @class
*/
class EncryptByWhiteBoxResponse extends AbstractModel {
constructor(){
super();
/**
* Base64-encoded initialization vector, which will be used by the encryption algorithm. If this parameter is passed in by the caller, it will be returned as-is; otherwise, the backend service will generate a random one and return it.
* @type {string || null}
*/
this.InitializationVector = null;
/**
* Base64-encoded ciphertext after encryption
* @type {string || null}
*/
this.CipherText = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.InitializationVector = 'InitializationVector' in params ? params.InitializationVector : null;
this.CipherText = 'CipherText' in params ? params.CipherText : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DescribeKeys response structure.
* @class
*/
class DescribeKeysResponse extends AbstractModel {
constructor(){
super();
/**
* List of returned attribute information
Note: this field may return null, indicating that no valid values can be obtained.
* @type {Array.<KeyMetadata> || null}
*/
this.KeyMetadatas = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
if (params.KeyMetadatas) {
this.KeyMetadatas = new Array();
for (let z in params.KeyMetadatas) {
let obj = new KeyMetadata();
obj.deserialize(params.KeyMetadatas[z]);
this.KeyMetadatas.push(obj);
}
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* EnableWhiteBoxKey response structure.
* @class
*/
class EnableWhiteBoxKeyResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* ReEncrypt request structure.
* @class
*/
class ReEncryptRequest extends AbstractModel {
constructor(){
super();
/**
* Ciphertext to be re-encrypted
* @type {string || null}
*/
this.CiphertextBlob = null;
/**
* CMK used for re-encryption. If this parameter is empty, the ciphertext will be re-encrypted by using the original CMK (as long as the key is not rotated, the ciphertext will not be refreshed)
* @type {string || null}
*/
this.DestinationKeyId = null;
/**
* JSON string of the key-value pair used during ciphertext encryption by `CiphertextBlob`. If not used during encryption, this parameter will be empty
* @type {string || null}
*/
this.SourceEncryptionContext = null;
/**
* JSON string of the key-value pair used during re-encryption. If this field is used, the same string should be entered when the returned new ciphertext is decrypted
* @type {string || null}
*/
this.DestinationEncryptionContext = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.CiphertextBlob = 'CiphertextBlob' in params ? params.CiphertextBlob : null;
this.DestinationKeyId = 'DestinationKeyId' in params ? params.DestinationKeyId : null;
this.SourceEncryptionContext = 'SourceEncryptionContext' in params ? params.SourceEncryptionContext : null;
this.DestinationEncryptionContext = 'DestinationEncryptionContext' in params ? params.DestinationEncryptionContext : null;
}
}
/**
* ListKeys response structure.
* @class
*/
class ListKeysResponse extends AbstractModel {
constructor(){
super();
/**
* CMK list array
* @type {Array.<Key> || null}
*/
this.Keys = null;
/**
* Total number of CMKs
* @type {number || null}
*/
this.TotalCount = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
if (params.Keys) {
this.Keys = new Array();
for (let z in params.Keys) {
let obj = new Key();
obj.deserialize(params.Keys[z]);
this.Keys.push(obj);
}
}
this.TotalCount = 'TotalCount' in params ? params.TotalCount : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* AsymmetricSm2Decrypt response structure.
* @class
*/
class AsymmetricSm2DecryptResponse extends AbstractModel {
constructor(){
super();
/**
* Unique CMK ID
* @type {string || null}
*/
this.KeyId = null;
/**
* Base64-encoded plaintext after decryption
* @type {string || null}
*/
this.Plaintext = null;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyId = 'KeyId' in params ? params.KeyId : null;
this.Plaintext = 'Plaintext' in params ? params.Plaintext : null;
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DisableKeyRotation response structure.
* @class
*/
class DisableKeyRotationResponse extends AbstractModel {
constructor(){
super();
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @type {string || null}
*/
this.RequestId = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.RequestId = 'RequestId' in params ? params.RequestId : null;
}
}
/**
* DisableWhiteBoxKeys request structure.
* @class
*/
class DisableWhiteBoxKeysRequest extends AbstractModel {
constructor(){
super();
/**
* List of globally unique white-box key IDs. Note: you should make sure that all provided `KeyId` values are in valid format, unique, and actually exist. Up to 50 ones are allowed.
* @type {Array.<string> || null}
*/
this.KeyIds = null;
}
/**
* @private
*/
deserialize(params) {
if (!params) {
return;
}
this.KeyIds = 'KeyIds' in params ? params.KeyIds : null;
}
}
/**
* ListKeyDetail request structure.
* @class
*/
class ListKeyDetailRequest extends AbstractModel {
constructor(){
super();
/**
* This parameter has the same meaning of the `Offset` in an SQL query, indicating that this acquisition starts from the "No. Offset value" element of the array arranged in a certain order. The default value is 0.
* @type {number || null}
*/
this.Offset = null;
/**
* This parameter has the same meaning of the `Limit` in an SQL query, indicating that up to `Limit` value elements can be obtained in this request. The default value is 10 and the maximum value is 200.
* @type {number || null}
*/
this.Limit = null;
/**
* Filters by creator role. 0 (default value): the CMK is created by the user; 1: the CMK is created automatically by an authorized Tencent Cloud service.
* @type {number || null}
*/
this.Role = null;
/**
* Sorts by CMK creation time. 0: descending; 1: ascending
* @type {number || null}
*/
this.OrderType = null;
/**
* Filters by CMK status. 0: all CMKs; 1: CMKs in `Enabled` status only; 2: CMKs in `Disabled` status only; 3: CMKs in `PendingDelete` status only (i.e., keys with schedule deletion enabled); 4: CMKs in `PendingImport` status only; 5: CMKs in `Archived` status only.
* @type {number || null}
*/
this.KeyState = null;
/**