From 30ab857c6bb38caf28d06cd30e516a6ca58a0c09 Mon Sep 17 00:00:00 2001 From: ucloud-bot Date: Fri, 7 Aug 2026 10:03:39 +0000 Subject: [PATCH] sdk: rolling update for 0.3.28 --- VERSION | 2 +- src/UKMS/Apis/CancelKeyDeletionRequest.php | 111 ++ src/UKMS/Apis/CancelKeyDeletionResponse.php | 26 + .../Apis/CancelScheduleKeyDeletionRequest.php | 90 ++ .../CancelScheduleKeyDeletionResponse.php | 26 + src/UKMS/Apis/CreateAliasRequest.php | 132 +++ src/UKMS/Apis/CreateAliasResponse.php | 26 + src/UKMS/Apis/CreateKeyRequest.php | 211 ++++ src/UKMS/Apis/CreateKeyResponse.php | 44 + src/UKMS/Apis/DecryptRequest.php | 172 +++ src/UKMS/Apis/DecryptResponse.php | 84 ++ src/UKMS/Apis/DeleteAliasRequest.php | 111 ++ src/UKMS/Apis/DeleteAliasResponse.php | 26 + src/UKMS/Apis/DescribeKeyRequest.php | 111 ++ src/UKMS/Apis/DescribeKeyResponse.php | 45 + src/UKMS/Apis/DisableKeyRequest.php | 111 ++ src/UKMS/Apis/DisableKeyResponse.php | 26 + src/UKMS/Apis/DisableKeyRotationRequest.php | 111 ++ src/UKMS/Apis/DisableKeyRotationResponse.php | 26 + src/UKMS/Apis/EnableKeyRequest.php | 111 ++ src/UKMS/Apis/EnableKeyResponse.php | 26 + src/UKMS/Apis/EnableKeyRotationRequest.php | 132 +++ src/UKMS/Apis/EnableKeyRotationResponse.php | 26 + src/UKMS/Apis/EncryptRequest.php | 173 +++ src/UKMS/Apis/EncryptResponse.php | 84 ++ src/UKMS/Apis/GenerateDataKeyPairRequest.php | 132 +++ src/UKMS/Apis/GenerateDataKeyPairResponse.php | 26 + ...rateDataKeyPairWithoutPlaintextRequest.php | 91 ++ ...ateDataKeyPairWithoutPlaintextResponse.php | 26 + src/UKMS/Apis/GenerateDataKeyRequest.php | 172 +++ src/UKMS/Apis/GenerateDataKeyResponse.php | 84 ++ ...GenerateDataKeyWithoutPlaintextRequest.php | 172 +++ ...enerateDataKeyWithoutPlaintextResponse.php | 64 + src/UKMS/Apis/GenerateMacRequest.php | 112 ++ src/UKMS/Apis/GenerateMacResponse.php | 26 + src/UKMS/Apis/GenerateRandomRequest.php | 91 ++ src/UKMS/Apis/GenerateRandomResponse.php | 26 + src/UKMS/Apis/GetKeyRotationStatusRequest.php | 111 ++ .../Apis/GetKeyRotationStatusResponse.php | 124 ++ src/UKMS/Apis/GetPublicKeyRequest.php | 111 ++ src/UKMS/Apis/GetPublicKeyResponse.php | 144 +++ src/UKMS/Apis/ListAliasesRequest.php | 150 +++ src/UKMS/Apis/ListAliasesResponse.php | 77 ++ src/UKMS/Apis/ListKeysRequest.php | 150 +++ src/UKMS/Apis/ListKeysResponse.php | 77 ++ .../Apis/ListScheduleDeletionKeysRequest.php | 109 ++ .../Apis/ListScheduleDeletionKeysResponse.php | 117 ++ src/UKMS/Apis/RotateKeyOnDemandRequest.php | 111 ++ src/UKMS/Apis/RotateKeyOnDemandResponse.php | 44 + src/UKMS/Apis/ScheduleKeyDeletionRequest.php | 111 ++ src/UKMS/Apis/ScheduleKeyDeletionResponse.php | 26 + src/UKMS/Apis/SignRequest.php | 173 +++ src/UKMS/Apis/SignResponse.php | 84 ++ src/UKMS/Apis/UpdateAliasRequest.php | 132 +++ src/UKMS/Apis/UpdateAliasResponse.php | 26 + src/UKMS/Apis/UpdateKeyDescriptionRequest.php | 132 +++ .../Apis/UpdateKeyDescriptionResponse.php | 64 + src/UKMS/Apis/VerifyMacRequest.php | 154 +++ src/UKMS/Apis/VerifyMacResponse.php | 26 + src/UKMS/Apis/VerifyRequest.php | 195 +++ src/UKMS/Apis/VerifyResponse.php | 84 ++ src/UKMS/Models/AliasInfo.php | 104 ++ src/UKMS/Models/CMK.php | 184 +++ src/UKMS/Models/DEK.php | 284 +++++ src/UKMS/Models/KeyMetadata.php | 264 +++++ .../Params/DecryptParamEncryptionContext.php | 26 + .../Params/EncryptParamEncryptionContext.php | 26 + .../GenerateDataKeyParamEncryptionContext.php | 26 + ...WithoutPlaintextParamEncryptionContext.php | 26 + src/UKMS/UKMSClient.php | 1047 +++++++++++++++++ 70 files changed, 7583 insertions(+), 1 deletion(-) create mode 100644 src/UKMS/Apis/CancelKeyDeletionRequest.php create mode 100644 src/UKMS/Apis/CancelKeyDeletionResponse.php create mode 100644 src/UKMS/Apis/CancelScheduleKeyDeletionRequest.php create mode 100644 src/UKMS/Apis/CancelScheduleKeyDeletionResponse.php create mode 100644 src/UKMS/Apis/CreateAliasRequest.php create mode 100644 src/UKMS/Apis/CreateAliasResponse.php create mode 100644 src/UKMS/Apis/CreateKeyRequest.php create mode 100644 src/UKMS/Apis/CreateKeyResponse.php create mode 100644 src/UKMS/Apis/DecryptRequest.php create mode 100644 src/UKMS/Apis/DecryptResponse.php create mode 100644 src/UKMS/Apis/DeleteAliasRequest.php create mode 100644 src/UKMS/Apis/DeleteAliasResponse.php create mode 100644 src/UKMS/Apis/DescribeKeyRequest.php create mode 100644 src/UKMS/Apis/DescribeKeyResponse.php create mode 100644 src/UKMS/Apis/DisableKeyRequest.php create mode 100644 src/UKMS/Apis/DisableKeyResponse.php create mode 100644 src/UKMS/Apis/DisableKeyRotationRequest.php create mode 100644 src/UKMS/Apis/DisableKeyRotationResponse.php create mode 100644 src/UKMS/Apis/EnableKeyRequest.php create mode 100644 src/UKMS/Apis/EnableKeyResponse.php create mode 100644 src/UKMS/Apis/EnableKeyRotationRequest.php create mode 100644 src/UKMS/Apis/EnableKeyRotationResponse.php create mode 100644 src/UKMS/Apis/EncryptRequest.php create mode 100644 src/UKMS/Apis/EncryptResponse.php create mode 100644 src/UKMS/Apis/GenerateDataKeyPairRequest.php create mode 100644 src/UKMS/Apis/GenerateDataKeyPairResponse.php create mode 100644 src/UKMS/Apis/GenerateDataKeyPairWithoutPlaintextRequest.php create mode 100644 src/UKMS/Apis/GenerateDataKeyPairWithoutPlaintextResponse.php create mode 100644 src/UKMS/Apis/GenerateDataKeyRequest.php create mode 100644 src/UKMS/Apis/GenerateDataKeyResponse.php create mode 100644 src/UKMS/Apis/GenerateDataKeyWithoutPlaintextRequest.php create mode 100644 src/UKMS/Apis/GenerateDataKeyWithoutPlaintextResponse.php create mode 100644 src/UKMS/Apis/GenerateMacRequest.php create mode 100644 src/UKMS/Apis/GenerateMacResponse.php create mode 100644 src/UKMS/Apis/GenerateRandomRequest.php create mode 100644 src/UKMS/Apis/GenerateRandomResponse.php create mode 100644 src/UKMS/Apis/GetKeyRotationStatusRequest.php create mode 100644 src/UKMS/Apis/GetKeyRotationStatusResponse.php create mode 100644 src/UKMS/Apis/GetPublicKeyRequest.php create mode 100644 src/UKMS/Apis/GetPublicKeyResponse.php create mode 100644 src/UKMS/Apis/ListAliasesRequest.php create mode 100644 src/UKMS/Apis/ListAliasesResponse.php create mode 100644 src/UKMS/Apis/ListKeysRequest.php create mode 100644 src/UKMS/Apis/ListKeysResponse.php create mode 100644 src/UKMS/Apis/ListScheduleDeletionKeysRequest.php create mode 100644 src/UKMS/Apis/ListScheduleDeletionKeysResponse.php create mode 100644 src/UKMS/Apis/RotateKeyOnDemandRequest.php create mode 100644 src/UKMS/Apis/RotateKeyOnDemandResponse.php create mode 100644 src/UKMS/Apis/ScheduleKeyDeletionRequest.php create mode 100644 src/UKMS/Apis/ScheduleKeyDeletionResponse.php create mode 100644 src/UKMS/Apis/SignRequest.php create mode 100644 src/UKMS/Apis/SignResponse.php create mode 100644 src/UKMS/Apis/UpdateAliasRequest.php create mode 100644 src/UKMS/Apis/UpdateAliasResponse.php create mode 100644 src/UKMS/Apis/UpdateKeyDescriptionRequest.php create mode 100644 src/UKMS/Apis/UpdateKeyDescriptionResponse.php create mode 100644 src/UKMS/Apis/VerifyMacRequest.php create mode 100644 src/UKMS/Apis/VerifyMacResponse.php create mode 100644 src/UKMS/Apis/VerifyRequest.php create mode 100644 src/UKMS/Apis/VerifyResponse.php create mode 100644 src/UKMS/Models/AliasInfo.php create mode 100644 src/UKMS/Models/CMK.php create mode 100644 src/UKMS/Models/DEK.php create mode 100644 src/UKMS/Models/KeyMetadata.php create mode 100644 src/UKMS/Params/DecryptParamEncryptionContext.php create mode 100644 src/UKMS/Params/EncryptParamEncryptionContext.php create mode 100644 src/UKMS/Params/GenerateDataKeyParamEncryptionContext.php create mode 100644 src/UKMS/Params/GenerateDataKeyWithoutPlaintextParamEncryptionContext.php create mode 100644 src/UKMS/UKMSClient.php diff --git a/VERSION b/VERSION index e01fa85..9578e94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.27 +0.3.28 diff --git a/src/UKMS/Apis/CancelKeyDeletionRequest.php b/src/UKMS/Apis/CancelKeyDeletionRequest.php new file mode 100644 index 0000000..9ad3b2e --- /dev/null +++ b/src/UKMS/Apis/CancelKeyDeletionRequest.php @@ -0,0 +1,111 @@ + "CancelKeyDeletion"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥 ID。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/CancelKeyDeletionResponse.php b/src/UKMS/Apis/CancelKeyDeletionResponse.php new file mode 100644 index 0000000..2fd4df8 --- /dev/null +++ b/src/UKMS/Apis/CancelKeyDeletionResponse.php @@ -0,0 +1,26 @@ + "CancelScheduleKeyDeletion"]); + $this->markRequired("KeyId"); + } + + + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 需要查看的主密钥对应的 KeyId + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 需要查看的主密钥对应的 KeyId + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: 资源id + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: 资源id + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/CancelScheduleKeyDeletionResponse.php b/src/UKMS/Apis/CancelScheduleKeyDeletionResponse.php new file mode 100644 index 0000000..6fe9af9 --- /dev/null +++ b/src/UKMS/Apis/CancelScheduleKeyDeletionResponse.php @@ -0,0 +1,26 @@ + "CreateAlias"]); + $this->markRequired("Region"); + $this->markRequired("AliasName"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * AliasName: 密钥别名,格式为 alias/name。 + * + * @return string|null + */ + public function getAliasName() + { + return $this->get("AliasName"); + } + + /** + * AliasName: 密钥别名,格式为 alias/name。 + * + * @param string $aliasName + */ + public function setAliasName($aliasName) + { + $this->set("AliasName", $aliasName); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/CreateAliasResponse.php b/src/UKMS/Apis/CreateAliasResponse.php new file mode 100644 index 0000000..2f814d1 --- /dev/null +++ b/src/UKMS/Apis/CreateAliasResponse.php @@ -0,0 +1,26 @@ + "CreateKey"]); + $this->markRequired("Region"); + $this->markRequired("ResourceId"); + } + + + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * Description: 密钥描述,最多 8192 字符。 + * + * @return string|null + */ + public function getDescription() + { + return $this->get("Description"); + } + + /** + * Description: 密钥描述,最多 8192 字符。 + * + * @param string $description + */ + public function setDescription($description) + { + $this->set("Description", $description); + } + + /** + * Alias: 可选密钥别名,格式为 alias/name。 + * + * @return string|null + */ + public function getAlias() + { + return $this->get("Alias"); + } + + /** + * Alias: 可选密钥别名,格式为 alias/name。 + * + * @param string $alias + */ + public function setAlias($alias) + { + $this->set("Alias", $alias); + } + + /** + * KeySpec: 密钥规格,默认 SYMMETRIC_DEFAULT(AES_256)。可选值:SYMMETRIC_DEFAULT(AES_256)、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * + * @return string|null + */ + public function getKeySpec() + { + return $this->get("KeySpec"); + } + + /** + * KeySpec: 密钥规格,默认 SYMMETRIC_DEFAULT(AES_256)。可选值:SYMMETRIC_DEFAULT(AES_256)、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * + * @param string $keySpec + */ + public function setKeySpec($keySpec) + { + $this->set("KeySpec", $keySpec); + } + + /** + * KeyUsage: 密钥用途 + * + * @return string|null + */ + public function getKeyUsage() + { + return $this->get("KeyUsage"); + } + + /** + * KeyUsage: 密钥用途 + * + * @param string $keyUsage + */ + public function setKeyUsage($keyUsage) + { + $this->set("KeyUsage", $keyUsage); + } + + /** + * Origin: 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 100660。 + * + * @return string|null + */ + public function getOrigin() + { + return $this->get("Origin"); + } + + /** + * Origin: 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 100660。 + * + * @param string $origin + */ + public function setOrigin($origin) + { + $this->set("Origin", $origin); + } + + /** + * DeletionProtection: 是否开启删除保护。可选值:true、false;默认 false。 + * + * @return string|null + */ + public function getDeletionProtection() + { + return $this->get("DeletionProtection"); + } + + /** + * DeletionProtection: 是否开启删除保护。可选值:true、false;默认 false。 + * + * @param string $deletionProtection + */ + public function setDeletionProtection($deletionProtection) + { + $this->set("DeletionProtection", $deletionProtection); + } +} diff --git a/src/UKMS/Apis/CreateKeyResponse.php b/src/UKMS/Apis/CreateKeyResponse.php new file mode 100644 index 0000000..5cc0970 --- /dev/null +++ b/src/UKMS/Apis/CreateKeyResponse.php @@ -0,0 +1,44 @@ +get("KeyId"); + } + + /** + * KeyId: 密钥 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } +} diff --git a/src/UKMS/Apis/DecryptRequest.php b/src/UKMS/Apis/DecryptRequest.php new file mode 100644 index 0000000..c77b11b --- /dev/null +++ b/src/UKMS/Apis/DecryptRequest.php @@ -0,0 +1,172 @@ + "Decrypt"]); + $this->markRequired("Region"); + $this->markRequired("CiphertextBlob"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * CiphertextBlob: 待解密密文。 + * + * @return string|null + */ + public function getCiphertextBlob() + { + return $this->get("CiphertextBlob"); + } + + /** + * CiphertextBlob: 待解密密文。 + * + * @param string $ciphertextBlob + */ + public function setCiphertextBlob($ciphertextBlob) + { + $this->set("CiphertextBlob", $ciphertextBlob); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * KeyId: 主密钥 KeyId;对称密钥可空,从 CiphertextBlob 自动识别;非对称必填。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 主密钥 KeyId;对称密钥可空,从 CiphertextBlob 自动识别;非对称必填。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * EncryptionContext: 加密上下文,JSON Object。 + * + * @return DecryptParamEncryptionContext|null + */ + public function getEncryptionContext() + { + return new DecryptParamEncryptionContext($this->get("EncryptionContext")); + } + + /** + * EncryptionContext: 加密上下文,JSON Object。 + * + * @param DecryptParamEncryptionContext $encryptionContext + */ + public function setEncryptionContext(array $encryptionContext) + { + $this->set("EncryptionContext", $encryptionContext->getAll()); + } + + /** + * EncryptionAlgorithm: 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填或使用默认 RSAES_OAEP_SHA_256。 + * + * @return string|null + */ + public function getEncryptionAlgorithm() + { + return $this->get("EncryptionAlgorithm"); + } + + /** + * EncryptionAlgorithm: 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填或使用默认 RSAES_OAEP_SHA_256。 + * + * @param string $encryptionAlgorithm + */ + public function setEncryptionAlgorithm($encryptionAlgorithm) + { + $this->set("EncryptionAlgorithm", $encryptionAlgorithm); + } +} diff --git a/src/UKMS/Apis/DecryptResponse.php b/src/UKMS/Apis/DecryptResponse.php new file mode 100644 index 0000000..c037d07 --- /dev/null +++ b/src/UKMS/Apis/DecryptResponse.php @@ -0,0 +1,84 @@ +get("Plaintext"); + } + + /** + * Plaintext: 解密后的明文,Base64 编码。 + * + * @param string $plaintext + */ + public function setPlaintext($plaintext) + { + $this->set("Plaintext", $plaintext); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * EncryptionAlgorithm: 实际使用的解密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * + * @return string|null + */ + public function getEncryptionAlgorithm() + { + return $this->get("EncryptionAlgorithm"); + } + + /** + * EncryptionAlgorithm: 实际使用的解密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * + * @param string $encryptionAlgorithm + */ + public function setEncryptionAlgorithm($encryptionAlgorithm) + { + $this->set("EncryptionAlgorithm", $encryptionAlgorithm); + } +} diff --git a/src/UKMS/Apis/DeleteAliasRequest.php b/src/UKMS/Apis/DeleteAliasRequest.php new file mode 100644 index 0000000..5720f95 --- /dev/null +++ b/src/UKMS/Apis/DeleteAliasRequest.php @@ -0,0 +1,111 @@ + "DeleteAlias"]); + $this->markRequired("Region"); + $this->markRequired("AliasName"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * AliasName: 密钥别名,格式为 alias/name。 + * + * @return string|null + */ + public function getAliasName() + { + return $this->get("AliasName"); + } + + /** + * AliasName: 密钥别名,格式为 alias/name。 + * + * @param string $aliasName + */ + public function setAliasName($aliasName) + { + $this->set("AliasName", $aliasName); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/DeleteAliasResponse.php b/src/UKMS/Apis/DeleteAliasResponse.php new file mode 100644 index 0000000..f1b4527 --- /dev/null +++ b/src/UKMS/Apis/DeleteAliasResponse.php @@ -0,0 +1,26 @@ + "DescribeKey"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/DescribeKeyResponse.php b/src/UKMS/Apis/DescribeKeyResponse.php new file mode 100644 index 0000000..9d31957 --- /dev/null +++ b/src/UKMS/Apis/DescribeKeyResponse.php @@ -0,0 +1,45 @@ +get("KeyMetadata")); + } + + /** + * KeyMetadata: 密钥元数据。 + * + * @param KeyMetadata $keyMetadata + */ + public function setKeyMetadata(array $keyMetadata) + { + $this->set("KeyMetadata", $keyMetadata->getAll()); + } +} diff --git a/src/UKMS/Apis/DisableKeyRequest.php b/src/UKMS/Apis/DisableKeyRequest.php new file mode 100644 index 0000000..6840c9d --- /dev/null +++ b/src/UKMS/Apis/DisableKeyRequest.php @@ -0,0 +1,111 @@ + "DisableKey"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥 DB 数字 ID。 + * + * @return integer|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 DB 数字 ID。 + * + * @param int $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/DisableKeyResponse.php b/src/UKMS/Apis/DisableKeyResponse.php new file mode 100644 index 0000000..ef0c4f4 --- /dev/null +++ b/src/UKMS/Apis/DisableKeyResponse.php @@ -0,0 +1,26 @@ + "DisableKeyRotation"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/DisableKeyRotationResponse.php b/src/UKMS/Apis/DisableKeyRotationResponse.php new file mode 100644 index 0000000..a6d8b9c --- /dev/null +++ b/src/UKMS/Apis/DisableKeyRotationResponse.php @@ -0,0 +1,26 @@ + "EnableKey"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥 DB 数字 ID。 + * + * @return integer|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 DB 数字 ID。 + * + * @param int $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/EnableKeyResponse.php b/src/UKMS/Apis/EnableKeyResponse.php new file mode 100644 index 0000000..68ff1ee --- /dev/null +++ b/src/UKMS/Apis/EnableKeyResponse.php @@ -0,0 +1,26 @@ + "EnableKeyRotation"]); + $this->markRequired("Region"); + $this->markRequired("ResourceId"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * RotationPeriodInDays: 轮转周期,单位天。取值范围 1~2560,默认 365。仅 SYMMETRIC_DEFAULT 且 Origin=UCLOUD_KMS 的密钥支持轮转。 + * + * @return integer|null + */ + public function getRotationPeriodInDays() + { + return $this->get("RotationPeriodInDays"); + } + + /** + * RotationPeriodInDays: 轮转周期,单位天。取值范围 1~2560,默认 365。仅 SYMMETRIC_DEFAULT 且 Origin=UCLOUD_KMS 的密钥支持轮转。 + * + * @param int $rotationPeriodInDays + */ + public function setRotationPeriodInDays($rotationPeriodInDays) + { + $this->set("RotationPeriodInDays", $rotationPeriodInDays); + } +} diff --git a/src/UKMS/Apis/EnableKeyRotationResponse.php b/src/UKMS/Apis/EnableKeyRotationResponse.php new file mode 100644 index 0000000..b963229 --- /dev/null +++ b/src/UKMS/Apis/EnableKeyRotationResponse.php @@ -0,0 +1,26 @@ + "Encrypt"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + $this->markRequired("Plaintext"); + } + + + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * Plaintext: 待加密明文,Base64 编码。 + * + * @return string|null + */ + public function getPlaintext() + { + return $this->get("Plaintext"); + } + + /** + * Plaintext: 待加密明文,Base64 编码。 + * + * @param string $plaintext + */ + public function setPlaintext($plaintext) + { + $this->set("Plaintext", $plaintext); + } + + /** + * EncryptionContext: 加密上下文,JSON Object。 + * + * @return EncryptParamEncryptionContext|null + */ + public function getEncryptionContext() + { + return new EncryptParamEncryptionContext($this->get("EncryptionContext")); + } + + /** + * EncryptionContext: 加密上下文,JSON Object。 + * + * @param EncryptParamEncryptionContext $encryptionContext + */ + public function setEncryptionContext(array $encryptionContext) + { + $this->set("EncryptionContext", $encryptionContext->getAll()); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * EncryptionAlgorithm: 加密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;对称密钥默认 SYMMETRIC_DEFAULT,RSA 默认 RSAES_OAEP_SHA_256。 + * + * @return string|null + */ + public function getEncryptionAlgorithm() + { + return $this->get("EncryptionAlgorithm"); + } + + /** + * EncryptionAlgorithm: 加密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;对称密钥默认 SYMMETRIC_DEFAULT,RSA 默认 RSAES_OAEP_SHA_256。 + * + * @param string $encryptionAlgorithm + */ + public function setEncryptionAlgorithm($encryptionAlgorithm) + { + $this->set("EncryptionAlgorithm", $encryptionAlgorithm); + } +} diff --git a/src/UKMS/Apis/EncryptResponse.php b/src/UKMS/Apis/EncryptResponse.php new file mode 100644 index 0000000..a9114f8 --- /dev/null +++ b/src/UKMS/Apis/EncryptResponse.php @@ -0,0 +1,84 @@ +get("CiphertextBlob"); + } + + /** + * CiphertextBlob: 加密后的密文。 + * + * @param string $ciphertextBlob + */ + public function setCiphertextBlob($ciphertextBlob) + { + $this->set("CiphertextBlob", $ciphertextBlob); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * EncryptionAlgorithm: 实际使用的加密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * + * @return string|null + */ + public function getEncryptionAlgorithm() + { + return $this->get("EncryptionAlgorithm"); + } + + /** + * EncryptionAlgorithm: 实际使用的加密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * + * @param string $encryptionAlgorithm + */ + public function setEncryptionAlgorithm($encryptionAlgorithm) + { + $this->set("EncryptionAlgorithm", $encryptionAlgorithm); + } +} diff --git a/src/UKMS/Apis/GenerateDataKeyPairRequest.php b/src/UKMS/Apis/GenerateDataKeyPairRequest.php new file mode 100644 index 0000000..c37376f --- /dev/null +++ b/src/UKMS/Apis/GenerateDataKeyPairRequest.php @@ -0,0 +1,132 @@ + "GenerateDataKeyPair"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + $this->markRequired("KeyPairSpec"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥ID + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥ID + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * KeyPairSpec: 密钥类型 + * + * @return string|null + */ + public function getKeyPairSpec() + { + return $this->get("KeyPairSpec"); + } + + /** + * KeyPairSpec: 密钥类型 + * + * @param string $keyPairSpec + */ + public function setKeyPairSpec($keyPairSpec) + { + $this->set("KeyPairSpec", $keyPairSpec); + } + + /** + * EncryptionContext: 加密上下文 + * + * @return string|null + */ + public function getEncryptionContext() + { + return $this->get("EncryptionContext"); + } + + /** + * EncryptionContext: 加密上下文 + * + * @param string $encryptionContext + */ + public function setEncryptionContext($encryptionContext) + { + $this->set("EncryptionContext", $encryptionContext); + } +} diff --git a/src/UKMS/Apis/GenerateDataKeyPairResponse.php b/src/UKMS/Apis/GenerateDataKeyPairResponse.php new file mode 100644 index 0000000..e2d24df --- /dev/null +++ b/src/UKMS/Apis/GenerateDataKeyPairResponse.php @@ -0,0 +1,26 @@ + "GenerateDataKeyPairWithoutPlaintext"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥ID + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥ID + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } +} diff --git a/src/UKMS/Apis/GenerateDataKeyPairWithoutPlaintextResponse.php b/src/UKMS/Apis/GenerateDataKeyPairWithoutPlaintextResponse.php new file mode 100644 index 0000000..635b7fa --- /dev/null +++ b/src/UKMS/Apis/GenerateDataKeyPairWithoutPlaintextResponse.php @@ -0,0 +1,26 @@ + "GenerateDataKey"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * KeySpec: 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。 + * + * @return string|null + */ + public function getKeySpec() + { + return $this->get("KeySpec"); + } + + /** + * KeySpec: 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。 + * + * @param string $keySpec + */ + public function setKeySpec($keySpec) + { + $this->set("KeySpec", $keySpec); + } + + /** + * NumberOfBytes: 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。 + * + * @return integer|null + */ + public function getNumberOfBytes() + { + return $this->get("NumberOfBytes"); + } + + /** + * NumberOfBytes: 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。 + * + * @param int $numberOfBytes + */ + public function setNumberOfBytes($numberOfBytes) + { + $this->set("NumberOfBytes", $numberOfBytes); + } + + /** + * EncryptionContext: 加密上下文,JSON Object。 + * + * @return GenerateDataKeyParamEncryptionContext|null + */ + public function getEncryptionContext() + { + return new GenerateDataKeyParamEncryptionContext($this->get("EncryptionContext")); + } + + /** + * EncryptionContext: 加密上下文,JSON Object。 + * + * @param GenerateDataKeyParamEncryptionContext $encryptionContext + */ + public function setEncryptionContext(array $encryptionContext) + { + $this->set("EncryptionContext", $encryptionContext->getAll()); + } +} diff --git a/src/UKMS/Apis/GenerateDataKeyResponse.php b/src/UKMS/Apis/GenerateDataKeyResponse.php new file mode 100644 index 0000000..9a9bbe9 --- /dev/null +++ b/src/UKMS/Apis/GenerateDataKeyResponse.php @@ -0,0 +1,84 @@ +get("Plaintext"); + } + + /** + * Plaintext: 数据密钥明文,Base64 编码。 + * + * @param string $plaintext + */ + public function setPlaintext($plaintext) + { + $this->set("Plaintext", $plaintext); + } + + /** + * CiphertextBlob: 加密后的数据密钥。 + * + * @return string|null + */ + public function getCiphertextBlob() + { + return $this->get("CiphertextBlob"); + } + + /** + * CiphertextBlob: 加密后的数据密钥。 + * + * @param string $ciphertextBlob + */ + public function setCiphertextBlob($ciphertextBlob) + { + $this->set("CiphertextBlob", $ciphertextBlob); + } + + /** + * KeyId: 加密该数据密钥的密钥资源长 ID。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 加密该数据密钥的密钥资源长 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } +} diff --git a/src/UKMS/Apis/GenerateDataKeyWithoutPlaintextRequest.php b/src/UKMS/Apis/GenerateDataKeyWithoutPlaintextRequest.php new file mode 100644 index 0000000..d280415 --- /dev/null +++ b/src/UKMS/Apis/GenerateDataKeyWithoutPlaintextRequest.php @@ -0,0 +1,172 @@ + "GenerateDataKeyWithoutPlaintext"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * KeySpec: 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。 + * + * @return string|null + */ + public function getKeySpec() + { + return $this->get("KeySpec"); + } + + /** + * KeySpec: 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。 + * + * @param string $keySpec + */ + public function setKeySpec($keySpec) + { + $this->set("KeySpec", $keySpec); + } + + /** + * NumberOfBytes: 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。 + * + * @return integer|null + */ + public function getNumberOfBytes() + { + return $this->get("NumberOfBytes"); + } + + /** + * NumberOfBytes: 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。 + * + * @param int $numberOfBytes + */ + public function setNumberOfBytes($numberOfBytes) + { + $this->set("NumberOfBytes", $numberOfBytes); + } + + /** + * EncryptionContext: 加密上下文,JSON Object。 + * + * @return GenerateDataKeyWithoutPlaintextParamEncryptionContext|null + */ + public function getEncryptionContext() + { + return new GenerateDataKeyWithoutPlaintextParamEncryptionContext($this->get("EncryptionContext")); + } + + /** + * EncryptionContext: 加密上下文,JSON Object。 + * + * @param GenerateDataKeyWithoutPlaintextParamEncryptionContext $encryptionContext + */ + public function setEncryptionContext(array $encryptionContext) + { + $this->set("EncryptionContext", $encryptionContext->getAll()); + } +} diff --git a/src/UKMS/Apis/GenerateDataKeyWithoutPlaintextResponse.php b/src/UKMS/Apis/GenerateDataKeyWithoutPlaintextResponse.php new file mode 100644 index 0000000..63325e7 --- /dev/null +++ b/src/UKMS/Apis/GenerateDataKeyWithoutPlaintextResponse.php @@ -0,0 +1,64 @@ +get("CiphertextBlob"); + } + + /** + * CiphertextBlob: 加密后的数据密钥。 + * + * @param string $ciphertextBlob + */ + public function setCiphertextBlob($ciphertextBlob) + { + $this->set("CiphertextBlob", $ciphertextBlob); + } + + /** + * KeyId: 加密该数据密钥的密钥资源长 ID。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 加密该数据密钥的密钥资源长 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } +} diff --git a/src/UKMS/Apis/GenerateMacRequest.php b/src/UKMS/Apis/GenerateMacRequest.php new file mode 100644 index 0000000..98a3b75 --- /dev/null +++ b/src/UKMS/Apis/GenerateMacRequest.php @@ -0,0 +1,112 @@ + "GenerateMac"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + $this->markRequired("MacMessage"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥ID + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥ID + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * MacMessage: 待哈希的消息。 + * + * @return string|null + */ + public function getMacMessage() + { + return $this->get("MacMessage"); + } + + /** + * MacMessage: 待哈希的消息。 + * + * @param string $macMessage + */ + public function setMacMessage($macMessage) + { + $this->set("MacMessage", $macMessage); + } +} diff --git a/src/UKMS/Apis/GenerateMacResponse.php b/src/UKMS/Apis/GenerateMacResponse.php new file mode 100644 index 0000000..11088a9 --- /dev/null +++ b/src/UKMS/Apis/GenerateMacResponse.php @@ -0,0 +1,26 @@ + "GenerateRandom"]); + $this->markRequired("Region"); + $this->markRequired("NumberOfBytes"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * NumberOfBytes: 随机数长度,最大1024 + * + * @return integer|null + */ + public function getNumberOfBytes() + { + return $this->get("NumberOfBytes"); + } + + /** + * NumberOfBytes: 随机数长度,最大1024 + * + * @param int $numberOfBytes + */ + public function setNumberOfBytes($numberOfBytes) + { + $this->set("NumberOfBytes", $numberOfBytes); + } +} diff --git a/src/UKMS/Apis/GenerateRandomResponse.php b/src/UKMS/Apis/GenerateRandomResponse.php new file mode 100644 index 0000000..d6efd7d --- /dev/null +++ b/src/UKMS/Apis/GenerateRandomResponse.php @@ -0,0 +1,26 @@ + "GetKeyRotationStatus"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/GetKeyRotationStatusResponse.php b/src/UKMS/Apis/GetKeyRotationStatusResponse.php new file mode 100644 index 0000000..2b4bd20 --- /dev/null +++ b/src/UKMS/Apis/GetKeyRotationStatusResponse.php @@ -0,0 +1,124 @@ +get("KeyRotationEnabled"); + } + + /** + * KeyRotationEnabled: 是否开启自动轮转。取值:true、false。 + * + * @param boolean $keyRotationEnabled + */ + public function setKeyRotationEnabled($keyRotationEnabled) + { + $this->set("KeyRotationEnabled", $keyRotationEnabled); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * RotationPeriodInDays: 轮转周期,单位天;未开启时返回 0。 + * + * @return integer|null + */ + public function getRotationPeriodInDays() + { + return $this->get("RotationPeriodInDays"); + } + + /** + * RotationPeriodInDays: 轮转周期,单位天;未开启时返回 0。 + * + * @param int $rotationPeriodInDays + */ + public function setRotationPeriodInDays($rotationPeriodInDays) + { + $this->set("RotationPeriodInDays", $rotationPeriodInDays); + } + + /** + * NextRotationDate: 下次轮转时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getNextRotationDate() + { + return $this->get("NextRotationDate"); + } + + /** + * NextRotationDate: 下次轮转时间,Unix 时间戳。 + * + * @param int $nextRotationDate + */ + public function setNextRotationDate($nextRotationDate) + { + $this->set("NextRotationDate", $nextRotationDate); + } + + /** + * OnDemandRotationStartDate: 按需轮转开始时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getOnDemandRotationStartDate() + { + return $this->get("OnDemandRotationStartDate"); + } + + /** + * OnDemandRotationStartDate: 按需轮转开始时间,Unix 时间戳。 + * + * @param int $onDemandRotationStartDate + */ + public function setOnDemandRotationStartDate($onDemandRotationStartDate) + { + $this->set("OnDemandRotationStartDate", $onDemandRotationStartDate); + } +} diff --git a/src/UKMS/Apis/GetPublicKeyRequest.php b/src/UKMS/Apis/GetPublicKeyRequest.php new file mode 100644 index 0000000..27b9aec --- /dev/null +++ b/src/UKMS/Apis/GetPublicKeyRequest.php @@ -0,0 +1,111 @@ + "GetPublicKey"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/GetPublicKeyResponse.php b/src/UKMS/Apis/GetPublicKeyResponse.php new file mode 100644 index 0000000..2538b75 --- /dev/null +++ b/src/UKMS/Apis/GetPublicKeyResponse.php @@ -0,0 +1,144 @@ +get("KeyId"); + } + + /** + * KeyId: 密钥 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * KmsPublicKey: PEM 或 DER 编码的公钥。 + * + * @return string|null + */ + public function getKmsPublicKey() + { + return $this->get("KmsPublicKey"); + } + + /** + * KmsPublicKey: PEM 或 DER 编码的公钥。 + * + * @param string $kmsPublicKey + */ + public function setKmsPublicKey($kmsPublicKey) + { + $this->set("KmsPublicKey", $kmsPublicKey); + } + + /** + * KeySpec: 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * + * @return string|null + */ + public function getKeySpec() + { + return $this->get("KeySpec"); + } + + /** + * KeySpec: 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * + * @param string $keySpec + */ + public function setKeySpec($keySpec) + { + $this->set("KeySpec", $keySpec); + } + + /** + * KeyUsage: 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * + * @return string[]|null + */ + public function getKeyUsage() + { + return $this->get("KeyUsage"); + } + + /** + * KeyUsage: 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * + * @param string[] $keyUsage + */ + public function setKeyUsage(array $keyUsage) + { + $this->set("KeyUsage", $keyUsage); + } + + /** + * SigningAlgorithms: 支持的签名算法列表。取值范围:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * + * @return string[]|null + */ + public function getSigningAlgorithms() + { + return $this->get("SigningAlgorithms"); + } + + /** + * SigningAlgorithms: 支持的签名算法列表。取值范围:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * + * @param string[] $signingAlgorithms + */ + public function setSigningAlgorithms(array $signingAlgorithms) + { + $this->set("SigningAlgorithms", $signingAlgorithms); + } + + /** + * EncryptionAlgorithms: 支持的加密算法列表。取值范围:RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * + * @return string[]|null + */ + public function getEncryptionAlgorithms() + { + return $this->get("EncryptionAlgorithms"); + } + + /** + * EncryptionAlgorithms: 支持的加密算法列表。取值范围:RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * + * @param string[] $encryptionAlgorithms + */ + public function setEncryptionAlgorithms(array $encryptionAlgorithms) + { + $this->set("EncryptionAlgorithms", $encryptionAlgorithms); + } +} diff --git a/src/UKMS/Apis/ListAliasesRequest.php b/src/UKMS/Apis/ListAliasesRequest.php new file mode 100644 index 0000000..bfe7783 --- /dev/null +++ b/src/UKMS/Apis/ListAliasesRequest.php @@ -0,0 +1,150 @@ + "ListAliases"]); + $this->markRequired("Region"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * KeyId: 可选:筛选指定密钥资源长 ID 的别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 可选:筛选指定密钥资源长 ID 的别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * Offset: 列表起始位置偏移量。 + * + * @return integer|null + */ + public function getOffset() + { + return $this->get("Offset"); + } + + /** + * Offset: 列表起始位置偏移量。 + * + * @param int $offset + */ + public function setOffset($offset) + { + $this->set("Offset", $offset); + } + + /** + * Limit: 返回数据长度。 + * + * @return integer|null + */ + public function getLimit() + { + return $this->get("Limit"); + } + + /** + * Limit: 返回数据长度。 + * + * @param int $limit + */ + public function setLimit($limit) + { + $this->set("Limit", $limit); + } +} diff --git a/src/UKMS/Apis/ListAliasesResponse.php b/src/UKMS/Apis/ListAliasesResponse.php new file mode 100644 index 0000000..e7317ca --- /dev/null +++ b/src/UKMS/Apis/ListAliasesResponse.php @@ -0,0 +1,77 @@ +get("TotalCount"); + } + + /** + * TotalCount: 别名总数。 + * + * @param int $totalCount + */ + public function setTotalCount($totalCount) + { + $this->set("TotalCount", $totalCount); + } + + /** + * Aliases: 别名列表,每项为 AliasInfo。 + * + * @return AliasInfo[]|null + */ + public function getAliases() + { + $items = $this->get("Aliases"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new AliasInfo($item)); + } + return $result; + } + + /** + * Aliases: 别名列表,每项为 AliasInfo。 + * + * @param AliasInfo[] $aliases + */ + public function setAliases(array $aliases) + { + $result = []; + foreach ($aliases as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/UKMS/Apis/ListKeysRequest.php b/src/UKMS/Apis/ListKeysRequest.php new file mode 100644 index 0000000..3ff708a --- /dev/null +++ b/src/UKMS/Apis/ListKeysRequest.php @@ -0,0 +1,150 @@ + "ListKeys"]); + $this->markRequired("Region"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * Alias: 按密钥 ID 或别名模糊过滤。 + * + * @return string|null + */ + public function getAlias() + { + return $this->get("Alias"); + } + + /** + * Alias: 按密钥 ID 或别名模糊过滤。 + * + * @param string $alias + */ + public function setAlias($alias) + { + $this->set("Alias", $alias); + } + + /** + * Offset: 列表起始位置偏移量。 + * + * @return integer|null + */ + public function getOffset() + { + return $this->get("Offset"); + } + + /** + * Offset: 列表起始位置偏移量。 + * + * @param int $offset + */ + public function setOffset($offset) + { + $this->set("Offset", $offset); + } + + /** + * Limit: 返回数据长度。最大1000 + * + * @return integer|null + */ + public function getLimit() + { + return $this->get("Limit"); + } + + /** + * Limit: 返回数据长度。最大1000 + * + * @param int $limit + */ + public function setLimit($limit) + { + $this->set("Limit", $limit); + } +} diff --git a/src/UKMS/Apis/ListKeysResponse.php b/src/UKMS/Apis/ListKeysResponse.php new file mode 100644 index 0000000..8031817 --- /dev/null +++ b/src/UKMS/Apis/ListKeysResponse.php @@ -0,0 +1,77 @@ +get("Data"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new DEK($item)); + } + return $result; + } + + /** + * Data: 密钥信息数组,每项为 DEK/ListKeys item。 + * + * @param DEK[] $data + */ + public function setData(array $data) + { + $result = []; + foreach ($data as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * TotalCount: 符合条件的总数,不同于 Limit。 + * + * @return integer|null + */ + public function getTotalCount() + { + return $this->get("TotalCount"); + } + + /** + * TotalCount: 符合条件的总数,不同于 Limit。 + * + * @param int $totalCount + */ + public function setTotalCount($totalCount) + { + $this->set("TotalCount", $totalCount); + } +} diff --git a/src/UKMS/Apis/ListScheduleDeletionKeysRequest.php b/src/UKMS/Apis/ListScheduleDeletionKeysRequest.php new file mode 100644 index 0000000..f35a0a6 --- /dev/null +++ b/src/UKMS/Apis/ListScheduleDeletionKeysRequest.php @@ -0,0 +1,109 @@ + "ListScheduleDeletionKeys"]); + } + + + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * Offset: 输出列表起始位置,默认从0开始 + * + * @return integer|null + */ + public function getOffset() + { + return $this->get("Offset"); + } + + /** + * Offset: 输出列表起始位置,默认从0开始 + * + * @param int $offset + */ + public function setOffset($offset) + { + $this->set("Offset", $offset); + } + + /** + * Limit: 输出列表数量,默认返回200个 + * + * @return integer|null + */ + public function getLimit() + { + return $this->get("Limit"); + } + + /** + * Limit: 输出列表数量,默认返回200个 + * + * @param int $limit + */ + public function setLimit($limit) + { + $this->set("Limit", $limit); + } + + /** + * OrderBy: 列表排序方式, 可选项: "-created_time", "created_time","plan_delete_time","-plan_delete_time";默认按-plan_delete_time 计划删除时间升序返回 + * + * @return string|null + */ + public function getOrderBy() + { + return $this->get("OrderBy"); + } + + /** + * OrderBy: 列表排序方式, 可选项: "-created_time", "created_time","plan_delete_time","-plan_delete_time";默认按-plan_delete_time 计划删除时间升序返回 + * + * @param string $orderBy + */ + public function setOrderBy($orderBy) + { + $this->set("OrderBy", $orderBy); + } +} diff --git a/src/UKMS/Apis/ListScheduleDeletionKeysResponse.php b/src/UKMS/Apis/ListScheduleDeletionKeysResponse.php new file mode 100644 index 0000000..504070e --- /dev/null +++ b/src/UKMS/Apis/ListScheduleDeletionKeysResponse.php @@ -0,0 +1,117 @@ +get("Objects"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new CMK($item)); + } + return $result; + } + + /** + * Objects: 主密钥信息组成的列表 + * + * @param CMK[] $objects + */ + public function setObjects(array $objects) + { + $result = []; + foreach ($objects as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * Status: 操作结果 + * + * @return string|null + */ + public function getStatus() + { + return $this->get("Status"); + } + + /** + * Status: 操作结果 + * + * @param string $status + */ + public function setStatus($status) + { + $this->set("Status", $status); + } + + /** + * RequestUuid: 请求唯一标识符 + * + * @return string|null + */ + public function getRequestUuid() + { + return $this->get("RequestUuid"); + } + + /** + * RequestUuid: 请求唯一标识符 + * + * @param string $requestUuid + */ + public function setRequestUuid($requestUuid) + { + $this->set("RequestUuid", $requestUuid); + } + + /** + * TotalCount: 符合条件的总数, 不同于Limit + * + * @return integer|null + */ + public function getTotalCount() + { + return $this->get("TotalCount"); + } + + /** + * TotalCount: 符合条件的总数, 不同于Limit + * + * @param int $totalCount + */ + public function setTotalCount($totalCount) + { + $this->set("TotalCount", $totalCount); + } +} diff --git a/src/UKMS/Apis/RotateKeyOnDemandRequest.php b/src/UKMS/Apis/RotateKeyOnDemandRequest.php new file mode 100644 index 0000000..869fcf4 --- /dev/null +++ b/src/UKMS/Apis/RotateKeyOnDemandRequest.php @@ -0,0 +1,111 @@ + "RotateKeyOnDemand"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/RotateKeyOnDemandResponse.php b/src/UKMS/Apis/RotateKeyOnDemandResponse.php new file mode 100644 index 0000000..805eac0 --- /dev/null +++ b/src/UKMS/Apis/RotateKeyOnDemandResponse.php @@ -0,0 +1,44 @@ +get("KeyId"); + } + + /** + * KeyId: 密钥 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } +} diff --git a/src/UKMS/Apis/ScheduleKeyDeletionRequest.php b/src/UKMS/Apis/ScheduleKeyDeletionRequest.php new file mode 100644 index 0000000..d42c212 --- /dev/null +++ b/src/UKMS/Apis/ScheduleKeyDeletionRequest.php @@ -0,0 +1,111 @@ + "ScheduleKeyDeletion"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥 DB 数字 ID。 + * + * @return integer|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 DB 数字 ID。 + * + * @param int $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/ScheduleKeyDeletionResponse.php b/src/UKMS/Apis/ScheduleKeyDeletionResponse.php new file mode 100644 index 0000000..4e76c40 --- /dev/null +++ b/src/UKMS/Apis/ScheduleKeyDeletionResponse.php @@ -0,0 +1,26 @@ + "Sign"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + $this->markRequired("SigningMessage"); + $this->markRequired("SigningAlgorithm"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * SigningMessage: 待签名消息,Base64 编码,最大 4096 字节。 + * + * @return string|null + */ + public function getSigningMessage() + { + return $this->get("SigningMessage"); + } + + /** + * SigningMessage: 待签名消息,Base64 编码,最大 4096 字节。 + * + * @param string $signingMessage + */ + public function setSigningMessage($signingMessage) + { + $this->set("SigningMessage", $signingMessage); + } + + /** + * SigningAlgorithm: 签名算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。 + * + * @return string|null + */ + public function getSigningAlgorithm() + { + return $this->get("SigningAlgorithm"); + } + + /** + * SigningAlgorithm: 签名算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。 + * + * @param string $signingAlgorithm + */ + public function setSigningAlgorithm($signingAlgorithm) + { + $this->set("SigningAlgorithm", $signingAlgorithm); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * MessageType: 消息类型。可选值:RAW、DIGEST;默认 RAW。 + * + * @return string|null + */ + public function getMessageType() + { + return $this->get("MessageType"); + } + + /** + * MessageType: 消息类型。可选值:RAW、DIGEST;默认 RAW。 + * + * @param string $messageType + */ + public function setMessageType($messageType) + { + $this->set("MessageType", $messageType); + } +} diff --git a/src/UKMS/Apis/SignResponse.php b/src/UKMS/Apis/SignResponse.php new file mode 100644 index 0000000..54ac285 --- /dev/null +++ b/src/UKMS/Apis/SignResponse.php @@ -0,0 +1,84 @@ +get("SignatureResult"); + } + + /** + * SignatureResult: 签名结果,Base64 编码。 + * + * @param string $signatureResult + */ + public function setSignatureResult($signatureResult) + { + $this->set("SignatureResult", $signatureResult); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * SigningAlgorithm: 实际使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * + * @return string|null + */ + public function getSigningAlgorithm() + { + return $this->get("SigningAlgorithm"); + } + + /** + * SigningAlgorithm: 实际使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * + * @param string $signingAlgorithm + */ + public function setSigningAlgorithm($signingAlgorithm) + { + $this->set("SigningAlgorithm", $signingAlgorithm); + } +} diff --git a/src/UKMS/Apis/UpdateAliasRequest.php b/src/UKMS/Apis/UpdateAliasRequest.php new file mode 100644 index 0000000..82a2677 --- /dev/null +++ b/src/UKMS/Apis/UpdateAliasRequest.php @@ -0,0 +1,132 @@ + "UpdateAlias"]); + $this->markRequired("Region"); + $this->markRequired("AliasName"); + $this->markRequired("KeyId"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * AliasName: 密钥别名,格式为 alias/name。 + * + * @return string|null + */ + public function getAliasName() + { + return $this->get("AliasName"); + } + + /** + * AliasName: 密钥别名,格式为 alias/name。 + * + * @param string $aliasName + */ + public function setAliasName($aliasName) + { + $this->set("AliasName", $aliasName); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/UpdateAliasResponse.php b/src/UKMS/Apis/UpdateAliasResponse.php new file mode 100644 index 0000000..bc800a5 --- /dev/null +++ b/src/UKMS/Apis/UpdateAliasResponse.php @@ -0,0 +1,26 @@ + "UpdateKeyDescription"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + $this->markRequired("Description"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * Description: 新的密钥描述,最多 8192 字符;空字符串表示清空描述。 + * + * @return string|null + */ + public function getDescription() + { + return $this->get("Description"); + } + + /** + * Description: 新的密钥描述,最多 8192 字符;空字符串表示清空描述。 + * + * @param string $description + */ + public function setDescription($description) + { + $this->set("Description", $description); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } +} diff --git a/src/UKMS/Apis/UpdateKeyDescriptionResponse.php b/src/UKMS/Apis/UpdateKeyDescriptionResponse.php new file mode 100644 index 0000000..6c1266f --- /dev/null +++ b/src/UKMS/Apis/UpdateKeyDescriptionResponse.php @@ -0,0 +1,64 @@ +get("Status"); + } + + /** + * Status: 返回状态。 + * + * @param string $status + */ + public function setStatus($status) + { + $this->set("Status", $status); + } + + /** + * RequestUuid: 此次请求唯一标识符。 + * + * @return string|null + */ + public function getRequestUuid() + { + return $this->get("RequestUuid"); + } + + /** + * RequestUuid: 此次请求唯一标识符。 + * + * @param string $requestUuid + */ + public function setRequestUuid($requestUuid) + { + $this->set("RequestUuid", $requestUuid); + } +} diff --git a/src/UKMS/Apis/VerifyMacRequest.php b/src/UKMS/Apis/VerifyMacRequest.php new file mode 100644 index 0000000..9004516 --- /dev/null +++ b/src/UKMS/Apis/VerifyMacRequest.php @@ -0,0 +1,154 @@ + "VerifyMac"]); + $this->markRequired("Region"); + $this->markRequired("KeyId"); + $this->markRequired("MacMessage"); + $this->markRequired("Mac"); + $this->markRequired("MacAlgorithm"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * KeyId: 密钥ID + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥ID + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * MacMessage: 用于验证的消息。请输入与生成 HMAC 时所用消息相同的消息。 + * + * @return string|null + */ + public function getMacMessage() + { + return $this->get("MacMessage"); + } + + /** + * MacMessage: 用于验证的消息。请输入与生成 HMAC 时所用消息相同的消息。 + * + * @param string $macMessage + */ + public function setMacMessage($macMessage) + { + $this->set("MacMessage", $macMessage); + } + + /** + * Mac: 要验证的 HMAC。请输入由 GenerateMac 操作生成的 HMAC,前提是您指定的消息、HMAC KMS 密钥和 MAC 算法与此请求中指定的值相同。 + * + * @return string|null + */ + public function getMac() + { + return $this->get("Mac"); + } + + /** + * Mac: 要验证的 HMAC。请输入由 GenerateMac 操作生成的 HMAC,前提是您指定的消息、HMAC KMS 密钥和 MAC 算法与此请求中指定的值相同。 + * + * @param string $mac + */ + public function setMac($mac) + { + $this->set("Mac", $mac); + } + + /** + * MacAlgorithm: 验证过程中将使用的 MAC 算法。请输入与计算 HMAC 时相同的 MAC 算法。此算法必须受 KeyId 参数标识的 HMAC KMS 密钥支持。 + * + * @return string|null + */ + public function getMacAlgorithm() + { + return $this->get("MacAlgorithm"); + } + + /** + * MacAlgorithm: 验证过程中将使用的 MAC 算法。请输入与计算 HMAC 时相同的 MAC 算法。此算法必须受 KeyId 参数标识的 HMAC KMS 密钥支持。 + * + * @param string $macAlgorithm + */ + public function setMacAlgorithm($macAlgorithm) + { + $this->set("MacAlgorithm", $macAlgorithm); + } +} diff --git a/src/UKMS/Apis/VerifyMacResponse.php b/src/UKMS/Apis/VerifyMacResponse.php new file mode 100644 index 0000000..71ea57a --- /dev/null +++ b/src/UKMS/Apis/VerifyMacResponse.php @@ -0,0 +1,26 @@ + "Verify"]); + $this->markRequired("Region"); + $this->markRequired("ResourceId"); + $this->markRequired("KeyId"); + $this->markRequired("SigningMessage"); + $this->markRequired("SignatureResult"); + $this->markRequired("SigningAlgorithm"); + } + + + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。参见地域和可用区列表。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子账号必须填写。 + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @return string|null + */ + public function getKeyId() + { + return $this->get("KeyId"); + } + + /** + * KeyId: 密钥 ID、ARN 或别名。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * SigningMessage: 待验签的消息或消息摘要,Base64 编码。 + * + * @return string|null + */ + public function getSigningMessage() + { + return $this->get("SigningMessage"); + } + + /** + * SigningMessage: 待验签的消息或消息摘要,Base64 编码。 + * + * @param string $signingMessage + */ + public function setSigningMessage($signingMessage) + { + $this->set("SigningMessage", $signingMessage); + } + + /** + * SignatureResult: 待验证的签名,Base64 编码。 + * + * @return string|null + */ + public function getSignatureResult() + { + return $this->get("SignatureResult"); + } + + /** + * SignatureResult: 待验证的签名,Base64 编码。 + * + * @param string $signatureResult + */ + public function setSignatureResult($signatureResult) + { + $this->set("SignatureResult", $signatureResult); + } + + /** + * SigningAlgorithm: 签名时使用的算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。 + * + * @return string|null + */ + public function getSigningAlgorithm() + { + return $this->get("SigningAlgorithm"); + } + + /** + * SigningAlgorithm: 签名时使用的算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。 + * + * @param string $signingAlgorithm + */ + public function setSigningAlgorithm($signingAlgorithm) + { + $this->set("SigningAlgorithm", $signingAlgorithm); + } + + /** + * MessageType: 消息类型。可选值:RAW、DIGEST;默认 RAW。 + * + * @return string|null + */ + public function getMessageType() + { + return $this->get("MessageType"); + } + + /** + * MessageType: 消息类型。可选值:RAW、DIGEST;默认 RAW。 + * + * @param string $messageType + */ + public function setMessageType($messageType) + { + $this->set("MessageType", $messageType); + } +} diff --git a/src/UKMS/Apis/VerifyResponse.php b/src/UKMS/Apis/VerifyResponse.php new file mode 100644 index 0000000..571db01 --- /dev/null +++ b/src/UKMS/Apis/VerifyResponse.php @@ -0,0 +1,84 @@ +get("KeyId"); + } + + /** + * KeyId: 密钥 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * SignatureValid: 签名是否有效。 + * + * @return boolean|null + */ + public function getSignatureValid() + { + return $this->get("SignatureValid"); + } + + /** + * SignatureValid: 签名是否有效。 + * + * @param boolean $signatureValid + */ + public function setSignatureValid($signatureValid) + { + $this->set("SignatureValid", $signatureValid); + } + + /** + * SigningAlgorithm: 使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * + * @return string|null + */ + public function getSigningAlgorithm() + { + return $this->get("SigningAlgorithm"); + } + + /** + * SigningAlgorithm: 使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * + * @param string $signingAlgorithm + */ + public function setSigningAlgorithm($signingAlgorithm) + { + $this->set("SigningAlgorithm", $signingAlgorithm); + } +} diff --git a/src/UKMS/Models/AliasInfo.php b/src/UKMS/Models/AliasInfo.php new file mode 100644 index 0000000..2fb6fc9 --- /dev/null +++ b/src/UKMS/Models/AliasInfo.php @@ -0,0 +1,104 @@ +get("AliasName"); + } + + /** + * AliasName: 别名,含 alias/ 前缀。 + * + * @param string $aliasName + */ + public function setAliasName($aliasName) + { + $this->set("AliasName", $aliasName); + } + + /** + * TargetKeyId: 别名指向的密钥资源长 ID。 + * + * @return string|null + */ + public function getTargetKeyId() + { + return $this->get("TargetKeyId"); + } + + /** + * TargetKeyId: 别名指向的密钥资源长 ID。 + * + * @param string $targetKeyId + */ + public function setTargetKeyId($targetKeyId) + { + $this->set("TargetKeyId", $targetKeyId); + } + + /** + * CreationDate: 创建时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getCreationDate() + { + return $this->get("CreationDate"); + } + + /** + * CreationDate: 创建时间,Unix 时间戳。 + * + * @param int $creationDate + */ + public function setCreationDate($creationDate) + { + $this->set("CreationDate", $creationDate); + } + + /** + * LastUpdatedDate: 最后更新时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getLastUpdatedDate() + { + return $this->get("LastUpdatedDate"); + } + + /** + * LastUpdatedDate: 最后更新时间,Unix 时间戳。 + * + * @param int $lastUpdatedDate + */ + public function setLastUpdatedDate($lastUpdatedDate) + { + $this->set("LastUpdatedDate", $lastUpdatedDate); + } +} diff --git a/src/UKMS/Models/CMK.php b/src/UKMS/Models/CMK.php new file mode 100644 index 0000000..cccedbe --- /dev/null +++ b/src/UKMS/Models/CMK.php @@ -0,0 +1,184 @@ +get("KeyId"); + } + + /** + * KeyId: CMK 的唯一标识符 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * Type: 密钥类型,仅支持UCloudManagedKeys、CustomerManagedKeys。默认值CustomerManagedKeys + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: 密钥类型,仅支持UCloudManagedKeys、CustomerManagedKeys。默认值CustomerManagedKeys + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * Description: 对密钥的描述说明 + * + * @return string|null + */ + public function getDescription() + { + return $this->get("Description"); + } + + /** + * Description: 对密钥的描述说明 + * + * @param string $description + */ + public function setDescription($description) + { + $this->set("Description", $description); + } + + /** + * Enabled: 是否启用 + * + * @return boolean|null + */ + public function getEnabled() + { + return $this->get("Enabled"); + } + + /** + * Enabled: 是否启用 + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * CreatedTime: 创建时间 时间戳 + * + * @return integer|null + */ + public function getCreatedTime() + { + return $this->get("CreatedTime"); + } + + /** + * CreatedTime: 创建时间 时间戳 + * + * @param int $createdTime + */ + public function setCreatedTime($createdTime) + { + $this->set("CreatedTime", $createdTime); + } + + /** + * LastModifiedTime: 最后修改时间 时间戳 + * + * @return integer|null + */ + public function getLastModifiedTime() + { + return $this->get("LastModifiedTime"); + } + + /** + * LastModifiedTime: 最后修改时间 时间戳 + * + * @param int $lastModifiedTime + */ + public function setLastModifiedTime($lastModifiedTime) + { + $this->set("LastModifiedTime", $lastModifiedTime); + } + + /** + * Alias: 别名,与CMK一一对应 + * + * @return string|null + */ + public function getAlias() + { + return $this->get("Alias"); + } + + /** + * Alias: 别名,与CMK一一对应 + * + * @param string $alias + */ + public function setAlias($alias) + { + $this->set("Alias", $alias); + } + + /** + * PlanDeleteTime: 计划删除时间 时间戳 + * + * @return integer|null + */ + public function getPlanDeleteTime() + { + return $this->get("PlanDeleteTime"); + } + + /** + * PlanDeleteTime: 计划删除时间 时间戳 + * + * @param int $planDeleteTime + */ + public function setPlanDeleteTime($planDeleteTime) + { + $this->set("PlanDeleteTime", $planDeleteTime); + } +} diff --git a/src/UKMS/Models/DEK.php b/src/UKMS/Models/DEK.php new file mode 100644 index 0000000..f38cf38 --- /dev/null +++ b/src/UKMS/Models/DEK.php @@ -0,0 +1,284 @@ +get("KeyId"); + } + + /** + * KeyId: 对外主密钥 ID(ukms_key_info.key_id)。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * KeySpec: 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * + * @return string|null + */ + public function getKeySpec() + { + return $this->get("KeySpec"); + } + + /** + * KeySpec: 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * + * @param string $keySpec + */ + public function setKeySpec($keySpec) + { + $this->set("KeySpec", $keySpec); + } + + /** + * KeyUsage: 按 KeySpec 派生的密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * + * @return string[]|null + */ + public function getKeyUsage() + { + return $this->get("KeyUsage"); + } + + /** + * KeyUsage: 按 KeySpec 派生的密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * + * @param string[] $keyUsage + */ + public function setKeyUsage(array $keyUsage) + { + $this->set("KeyUsage", $keyUsage); + } + + /** + * Origin: 密钥来源,由 Origin 派生。取值:ucloud、import。当前 CreateKey 仅支持 ucloud。 + * + * @return string|null + */ + public function getOrigin() + { + return $this->get("Origin"); + } + + /** + * Origin: 密钥来源,由 Origin 派生。取值:ucloud、import。当前 CreateKey 仅支持 ucloud。 + * + * @param string $origin + */ + public function setOrigin($origin) + { + $this->set("Origin", $origin); + } + + /** + * Status: 数据库密钥状态。常见取值:Active、Deactivated、PendingDeletion。 + * + * @return string|null + */ + public function getStatus() + { + return $this->get("Status"); + } + + /** + * Status: 数据库密钥状态。常见取值:Active、Deactivated、PendingDeletion。 + * + * @param string $status + */ + public function setStatus($status) + { + $this->set("Status", $status); + } + + /** + * CreatedTime: 创建时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getCreatedTime() + { + return $this->get("CreatedTime"); + } + + /** + * CreatedTime: 创建时间,Unix 时间戳。 + * + * @param int $createdTime + */ + public function setCreatedTime($createdTime) + { + $this->set("CreatedTime", $createdTime); + } + + /** + * UpdateTime: 更新时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getUpdateTime() + { + return $this->get("UpdateTime"); + } + + /** + * UpdateTime: 更新时间,Unix 时间戳。 + * + * @param int $updateTime + */ + public function setUpdateTime($updateTime) + { + $this->set("UpdateTime", $updateTime); + } + + /** + * KeyRotationEnabled: 是否已开启自动轮转;未配置或已关闭均为 false + * + * @return boolean|null + */ + public function getKeyRotationEnabled() + { + return $this->get("KeyRotationEnabled"); + } + + /** + * KeyRotationEnabled: 是否已开启自动轮转;未配置或已关闭均为 false + * + * @param boolean $keyRotationEnabled + */ + public function setKeyRotationEnabled($keyRotationEnabled) + { + $this->set("KeyRotationEnabled", $keyRotationEnabled); + } + + /** + * RotationPeriodInDays: 自动轮转周期(天);未开启时为 0 + * + * @return integer|null + */ + public function getRotationPeriodInDays() + { + return $this->get("RotationPeriodInDays"); + } + + /** + * RotationPeriodInDays: 自动轮转周期(天);未开启时为 0 + * + * @param int $rotationPeriodInDays + */ + public function setRotationPeriodInDays($rotationPeriodInDays) + { + $this->set("RotationPeriodInDays", $rotationPeriodInDays); + } + + /** + * ResourceId: 密钥所属的 UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: 密钥所属的 UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * Description: 密钥描述。 + * + * @return string|null + */ + public function getDescription() + { + return $this->get("Description"); + } + + /** + * Description: 密钥描述。 + * + * @param string $description + */ + public function setDescription($description) + { + $this->set("Description", $description); + } + + /** + * PlanDeleteTime: 计划删除时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getPlanDeleteTime() + { + return $this->get("PlanDeleteTime"); + } + + /** + * PlanDeleteTime: 计划删除时间,Unix 时间戳。 + * + * @param int $planDeleteTime + */ + public function setPlanDeleteTime($planDeleteTime) + { + $this->set("PlanDeleteTime", $planDeleteTime); + } + + /** + * NextRotationDate: 下次自动轮转时间(Unix 时间戳,秒);仅在已开启自动轮转时返回。 + * + * @return integer|null + */ + public function getNextRotationDate() + { + return $this->get("NextRotationDate"); + } + + /** + * NextRotationDate: 下次自动轮转时间(Unix 时间戳,秒);仅在已开启自动轮转时返回。 + * + * @param int $nextRotationDate + */ + public function setNextRotationDate($nextRotationDate) + { + $this->set("NextRotationDate", $nextRotationDate); + } +} diff --git a/src/UKMS/Models/KeyMetadata.php b/src/UKMS/Models/KeyMetadata.php new file mode 100644 index 0000000..75236c8 --- /dev/null +++ b/src/UKMS/Models/KeyMetadata.php @@ -0,0 +1,264 @@ +get("KeyId"); + } + + /** + * KeyId: 密钥资源长 ID。 + * + * @param string $keyId + */ + public function setKeyId($keyId) + { + $this->set("KeyId", $keyId); + } + + /** + * CreationDate: 创建时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getCreationDate() + { + return $this->get("CreationDate"); + } + + /** + * CreationDate: 创建时间,Unix 时间戳。 + * + * @param int $creationDate + */ + public function setCreationDate($creationDate) + { + $this->set("CreationDate", $creationDate); + } + + /** + * Enabled: 是否启用。取值:true、false。 + * + * @return string|null + */ + public function getEnabled() + { + return $this->get("Enabled"); + } + + /** + * Enabled: 是否启用。取值:true、false。 + * + * @param string $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * KeyUsage: 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * + * @return string[]|null + */ + public function getKeyUsage() + { + return $this->get("KeyUsage"); + } + + /** + * KeyUsage: 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * + * @param string[] $keyUsage + */ + public function setKeyUsage(array $keyUsage) + { + $this->set("KeyUsage", $keyUsage); + } + + /** + * KeyState: 密钥对外状态。取值:Enabled、Disabled、PendingDeletion、PendingImport、Unavailable。 + * + * @return string|null + */ + public function getKeyState() + { + return $this->get("KeyState"); + } + + /** + * KeyState: 密钥对外状态。取值:Enabled、Disabled、PendingDeletion、PendingImport、Unavailable。 + * + * @param string $keyState + */ + public function setKeyState($keyState) + { + $this->set("KeyState", $keyState); + } + + /** + * Origin: 密钥材料来源。取值:UCLOUD_KMS、EXTERNAL;当前 CreateKey 仅支持 UCLOUD_KMS。 + * + * @return string|null + */ + public function getOrigin() + { + return $this->get("Origin"); + } + + /** + * Origin: 密钥材料来源。取值:UCLOUD_KMS、EXTERNAL;当前 CreateKey 仅支持 UCLOUD_KMS。 + * + * @param string $origin + */ + public function setOrigin($origin) + { + $this->set("Origin", $origin); + } + + /** + * KeySpec: 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * + * @return string|null + */ + public function getKeySpec() + { + return $this->get("KeySpec"); + } + + /** + * KeySpec: 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * + * @param string $keySpec + */ + public function setKeySpec($keySpec) + { + $this->set("KeySpec", $keySpec); + } + + /** + * DeletionProtection: 是否开启删除保护。取值:true、false。 + * + * @return string|null + */ + public function getDeletionProtection() + { + return $this->get("DeletionProtection"); + } + + /** + * DeletionProtection: 是否开启删除保护。取值:true、false。 + * + * @param string $deletionProtection + */ + public function setDeletionProtection($deletionProtection) + { + $this->set("DeletionProtection", $deletionProtection); + } + + /** + * KeyVersion: 当前密钥版本。 + * + * @return integer|null + */ + public function getKeyVersion() + { + return $this->get("KeyVersion"); + } + + /** + * KeyVersion: 当前密钥版本。 + * + * @param int $keyVersion + */ + public function setKeyVersion($keyVersion) + { + $this->set("KeyVersion", $keyVersion); + } + + /** + * ResourceId: 密钥所属的 UKMS 实例资源 ID。 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: 密钥所属的 UKMS 实例资源 ID。 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * Description: 密钥描述。 + * + * @return string|null + */ + public function getDescription() + { + return $this->get("Description"); + } + + /** + * Description: 密钥描述。 + * + * @param string $description + */ + public function setDescription($description) + { + $this->set("Description", $description); + } + + /** + * DeletionDate: 计划删除时间,Unix 时间戳。 + * + * @return integer|null + */ + public function getDeletionDate() + { + return $this->get("DeletionDate"); + } + + /** + * DeletionDate: 计划删除时间,Unix 时间戳。 + * + * @param int $deletionDate + */ + public function setDeletionDate($deletionDate) + { + $this->set("DeletionDate", $deletionDate); + } +} diff --git a/src/UKMS/Params/DecryptParamEncryptionContext.php b/src/UKMS/Params/DecryptParamEncryptionContext.php new file mode 100644 index 0000000..6fc3827 --- /dev/null +++ b/src/UKMS/Params/DecryptParamEncryptionContext.php @@ -0,0 +1,26 @@ + (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥 ID。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return CancelKeyDeletionResponse + * @throws UCloudException + */ + public function cancelKeyDeletion(CancelKeyDeletionRequest $request = null) + { + $resp = $this->invoke($request); + return new CancelKeyDeletionResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * CancelScheduleKeyDeletion - 取消计划删除密钥 + * + * See also: https://docs.ucloud.cn/api/ukms-api/cancel_schedule_key_deletion + * + * Arguments: + * + * $args = [ + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "KeyId" => (string) 需要查看的主密钥对应的 KeyId + * "ResourceId" => (string) 资源id + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return CancelScheduleKeyDeletionResponse + * @throws UCloudException + */ + public function cancelScheduleKeyDeletion(CancelScheduleKeyDeletionRequest $request = null) + { + $resp = $this->invoke($request); + return new CancelScheduleKeyDeletionResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * CreateAlias - 为密钥创建别名。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/create_alias + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "AliasName" => (string) 密钥别名,格式为 alias/name。 + * "KeyId" => (string) 密钥 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return CreateAliasResponse + * @throws UCloudException + */ + public function createAlias(CreateAliasRequest $request = null) + { + $resp = $this->invoke($request); + return new CreateAliasResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * CreateKey - 创建密钥。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/create_key + * + * Arguments: + * + * $args = [ + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "Description" => (string) 密钥描述,最多 8192 字符。 + * "Alias" => (string) 可选密钥别名,格式为 alias/name。 + * "KeySpec" => (string) 密钥规格,默认 SYMMETRIC_DEFAULT(AES_256)。可选值:SYMMETRIC_DEFAULT(AES_256)、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * "KeyUsage" => (string) 密钥用途 + * "Origin" => (string) 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 100660。 + * "DeletionProtection" => (string) 是否开启删除保护。可选值:true、false;默认 false。 + * ] + * + * Outputs: + * + * $outputs = [ + * "KeyId" => (string) 密钥 ID。 + * ] + * + * @return CreateKeyResponse + * @throws UCloudException + */ + public function createKey(CreateKeyRequest $request = null) + { + $resp = $this->invoke($request); + return new CreateKeyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * Decrypt - 您可以使用此操作解密使用对称加密 KMS 密钥或非对称加密 KMS 密钥加密的密文。当 KMS 密钥为非对称密钥时,您必须指定用于加密密文的 KMS 密钥和加密算法。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/decrypt + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "CiphertextBlob" => (string) 待解密密文。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "KeyId" => (string) 主密钥 KeyId;对称密钥可空,从 CiphertextBlob 自动识别;非对称必填。 + * "EncryptionContext" => (object) 加密上下文,JSON Object。 + * "EncryptionAlgorithm" => (string) 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填或使用默认 RSAES_OAEP_SHA_256。 + * ] + * + * Outputs: + * + * $outputs = [ + * "Plaintext" => (string) 解密后的明文,Base64 编码。 + * "KeyId" => (string) 密钥资源长 ID。 + * "EncryptionAlgorithm" => (string) 实际使用的解密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * ] + * + * @return DecryptResponse + * @throws UCloudException + */ + public function decrypt(DecryptRequest $request = null) + { + $resp = $this->invoke($request); + return new DecryptResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DeleteAlias - 删除密钥别名。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/delete_alias + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "AliasName" => (string) 密钥别名,格式为 alias/name。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return DeleteAliasResponse + * @throws UCloudException + */ + public function deleteAlias(DeleteAliasRequest $request = null) + { + $resp = $this->invoke($request); + return new DeleteAliasResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DescribeKey - 查看指定密钥的元数据。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/describe_key + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥资源长 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * "KeyMetadata" => (object) 密钥元数据。[ + * "KeyId" => (string) 密钥资源长 ID。 + * "CreationDate" => (integer) 创建时间,Unix 时间戳。 + * "Enabled" => (string) 是否启用。取值:true、false。 + * "KeyUsage" => (array) 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * "KeyState" => (string) 密钥对外状态。取值:Enabled、Disabled、PendingDeletion、PendingImport、Unavailable。 + * "Origin" => (string) 密钥材料来源。取值:UCLOUD_KMS、EXTERNAL;当前 CreateKey 仅支持 UCLOUD_KMS。 + * "KeySpec" => (string) 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * "DeletionProtection" => (string) 是否开启删除保护。取值:true、false。 + * "KeyVersion" => (integer) 当前密钥版本。 + * "ResourceId" => (string) 密钥所属的 UKMS 实例资源 ID。 + * "Description" => (string) 密钥描述。 + * "DeletionDate" => (integer) 计划删除时间,Unix 时间戳。 + * ] + * ] + * + * @return DescribeKeyResponse + * @throws UCloudException + */ + public function describeKey(DescribeKeyRequest $request = null) + { + $resp = $this->invoke($request); + return new DescribeKeyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DisableKey - 禁用指定密钥。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/disable_key + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (integer) 密钥 DB 数字 ID。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return DisableKeyResponse + * @throws UCloudException + */ + public function disableKey(DisableKeyRequest $request = null) + { + $resp = $this->invoke($request); + return new DisableKeyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DisableKeyRotation - 关闭密钥自动轮转。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/disable_key_rotation + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return DisableKeyRotationResponse + * @throws UCloudException + */ + public function disableKeyRotation(DisableKeyRotationRequest $request = null) + { + $resp = $this->invoke($request); + return new DisableKeyRotationResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * EnableKey - 启用指定密钥。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/enable_key + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (integer) 密钥 DB 数字 ID。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return EnableKeyResponse + * @throws UCloudException + */ + public function enableKey(EnableKeyRequest $request = null) + { + $resp = $this->invoke($request); + return new EnableKeyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * EnableKeyRotation - 开启对称密钥自动轮转。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/enable_key_rotation + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "KeyId" => (string) 密钥 ID、ARN 或别名。 + * "RotationPeriodInDays" => (integer) 轮转周期,单位天。取值范围 1~2560,默认 365。仅 SYMMETRIC_DEFAULT 且 Origin=UCLOUD_KMS 的密钥支持轮转。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return EnableKeyRotationResponse + * @throws UCloudException + */ + public function enableKeyRotation(EnableKeyRotationRequest $request = null) + { + $resp = $this->invoke($request); + return new EnableKeyRotationResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * Encrypt - 使用指定密钥加密明文数据。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/encrypt + * + * Arguments: + * + * $args = [ + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "Region" => (string) 地域。参见地域和可用区列表。 + * "KeyId" => (string) 密钥资源长 ID、ARN 或别名。 + * "Plaintext" => (string) 待加密明文,Base64 编码。 + * "EncryptionContext" => (object) 加密上下文,JSON Object。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "EncryptionAlgorithm" => (string) 加密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;对称密钥默认 SYMMETRIC_DEFAULT,RSA 默认 RSAES_OAEP_SHA_256。 + * ] + * + * Outputs: + * + * $outputs = [ + * "CiphertextBlob" => (string) 加密后的密文。 + * "KeyId" => (string) 密钥资源长 ID。 + * "EncryptionAlgorithm" => (string) 实际使用的加密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * ] + * + * @return EncryptResponse + * @throws UCloudException + */ + public function encrypt(EncryptRequest $request = null) + { + $resp = $this->invoke($request); + return new EncryptResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * GenerateDataKey - 生成数据密钥,返回明文和密文。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/generate_data_key + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥资源长 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "KeySpec" => (string) 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。 + * "NumberOfBytes" => (integer) 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。 + * "EncryptionContext" => (object) 加密上下文,JSON Object。 + * ] + * + * Outputs: + * + * $outputs = [ + * "Plaintext" => (string) 数据密钥明文,Base64 编码。 + * "CiphertextBlob" => (string) 加密后的数据密钥。 + * "KeyId" => (string) 加密该数据密钥的密钥资源长 ID。 + * ] + * + * @return GenerateDataKeyResponse + * @throws UCloudException + */ + public function generateDataKey(GenerateDataKeyRequest $request = null) + { + $resp = $this->invoke($request); + return new GenerateDataKeyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * GenerateDataKeyPair - 创建数据密钥对 + * + * See also: https://docs.ucloud.cn/api/ukms-api/generate_data_key_pair + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "KeyId" => (string) 密钥ID + * "KeyPairSpec" => (string) 密钥类型 + * "EncryptionContext" => (string) 加密上下文 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return GenerateDataKeyPairResponse + * @throws UCloudException + */ + public function generateDataKeyPair(GenerateDataKeyPairRequest $request = null) + { + $resp = $this->invoke($request); + return new GenerateDataKeyPairResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * GenerateDataKeyPairWithoutPlaintext - 创建数据密钥对(无明文返回) + * + * See also: https://docs.ucloud.cn/api/ukms-api/generate_data_key_pair_without_plaintext + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "KeyId" => (string) 密钥ID + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return GenerateDataKeyPairWithoutPlaintextResponse + * @throws UCloudException + */ + public function generateDataKeyPairWithoutPlaintext(GenerateDataKeyPairWithoutPlaintextRequest $request = null) + { + $resp = $this->invoke($request); + return new GenerateDataKeyPairWithoutPlaintextResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * GenerateDataKeyWithoutPlaintext - 创建数据密钥(无明文),仅返回加密后的数据密钥。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/generate_data_key_without_plaintext + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥资源长 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "KeySpec" => (string) 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。 + * "NumberOfBytes" => (integer) 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。 + * "EncryptionContext" => (object) 加密上下文,JSON Object。 + * ] + * + * Outputs: + * + * $outputs = [ + * "CiphertextBlob" => (string) 加密后的数据密钥。 + * "KeyId" => (string) 加密该数据密钥的密钥资源长 ID。 + * ] + * + * @return GenerateDataKeyWithoutPlaintextResponse + * @throws UCloudException + */ + public function generateDataKeyWithoutPlaintext(GenerateDataKeyWithoutPlaintextRequest $request = null) + { + $resp = $this->invoke($request); + return new GenerateDataKeyWithoutPlaintextResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * GenerateMac - 使用HMAC密钥管理服务(KMS)密钥和该密钥支持的MAC算法,为消息生成基于哈希的消息认证码(HMAC)。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/generate_mac + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "KeyId" => (string) 密钥ID + * "MacMessage" => (string) 待哈希的消息。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return GenerateMacResponse + * @throws UCloudException + */ + public function generateMac(GenerateMacRequest $request = null) + { + $resp = $this->invoke($request); + return new GenerateMacResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * GenerateRandom - 生成随机数 + * + * See also: https://docs.ucloud.cn/api/ukms-api/generate_random + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "NumberOfBytes" => (integer) 随机数长度,最大1024 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return GenerateRandomResponse + * @throws UCloudException + */ + public function generateRandom(GenerateRandomRequest $request = null) + { + $resp = $this->invoke($request); + return new GenerateRandomResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * GetKeyRotationStatus - 查询密钥自动轮转状态。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/get_key_rotation_status + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥资源长 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * "KeyRotationEnabled" => (boolean) 是否开启自动轮转。取值:true、false。 + * "KeyId" => (string) 密钥资源长 ID。 + * "RotationPeriodInDays" => (integer) 轮转周期,单位天;未开启时返回 0。 + * "NextRotationDate" => (integer) 下次轮转时间,Unix 时间戳。 + * "OnDemandRotationStartDate" => (integer) 按需轮转开始时间,Unix 时间戳。 + * ] + * + * @return GetKeyRotationStatusResponse + * @throws UCloudException + */ + public function getKeyRotationStatus(GetKeyRotationStatusRequest $request = null) + { + $resp = $this->invoke($request); + return new GetKeyRotationStatusResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * GetPublicKey - 获取非对称密钥的公钥。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/get_public_key + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * "KeyId" => (string) 密钥 ID。 + * "KmsPublicKey" => (string) PEM 或 DER 编码的公钥。 + * "KeySpec" => (string) 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * "KeyUsage" => (array) 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * "SigningAlgorithms" => (array) 支持的签名算法列表。取值范围:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * "EncryptionAlgorithms" => (array) 支持的加密算法列表。取值范围:RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。 + * ] + * + * @return GetPublicKeyResponse + * @throws UCloudException + */ + public function getPublicKey(GetPublicKeyRequest $request = null) + { + $resp = $this->invoke($request); + return new GetPublicKeyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * ListAliases - 获取 UKMS 实例下的别名列表。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/list_aliases + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "KeyId" => (string) 可选:筛选指定密钥资源长 ID 的别名。 + * "Offset" => (integer) 列表起始位置偏移量。 + * "Limit" => (integer) 返回数据长度。 + * ] + * + * Outputs: + * + * $outputs = [ + * "TotalCount" => (integer) 别名总数。 + * "Aliases" => (array) 别名列表,每项为 AliasInfo。[ + * [ + * "AliasName" => (string) 别名,含 alias/ 前缀。 + * "TargetKeyId" => (string) 别名指向的密钥资源长 ID。 + * "CreationDate" => (integer) 创建时间,Unix 时间戳。 + * "LastUpdatedDate" => (integer) 最后更新时间,Unix 时间戳。 + * ] + * ] + * ] + * + * @return ListAliasesResponse + * @throws UCloudException + */ + public function listAliases(ListAliasesRequest $request = null) + { + $resp = $this->invoke($request); + return new ListAliasesResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * ListKeys - 查询用户的主密钥信息列表。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/list_keys + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "Alias" => (string) 按密钥 ID 或别名模糊过滤。 + * "Offset" => (integer) 列表起始位置偏移量。 + * "Limit" => (integer) 返回数据长度。最大1000 + * ] + * + * Outputs: + * + * $outputs = [ + * "Data" => (array) 密钥信息数组,每项为 DEK/ListKeys item。[ + * [ + * "KeyId" => (string) 对外主密钥 ID(ukms_key_info.key_id)。 + * "KeySpec" => (string) 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 + * "KeyUsage" => (array) 按 KeySpec 派生的密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 + * "Origin" => (string) 密钥来源,由 Origin 派生。取值:ucloud、import。当前 CreateKey 仅支持 ucloud。 + * "Status" => (string) 数据库密钥状态。常见取值:Active、Deactivated、PendingDeletion。 + * "CreatedTime" => (integer) 创建时间,Unix 时间戳。 + * "UpdateTime" => (integer) 更新时间,Unix 时间戳。 + * "KeyRotationEnabled" => (boolean) 是否已开启自动轮转;未配置或已关闭均为 false + * "RotationPeriodInDays" => (integer) 自动轮转周期(天);未开启时为 0 + * "ResourceId" => (string) 密钥所属的 UKMS 实例资源 ID。 + * "Description" => (string) 密钥描述。 + * "PlanDeleteTime" => (integer) 计划删除时间,Unix 时间戳。 + * "NextRotationDate" => (integer) 下次自动轮转时间(Unix 时间戳,秒);仅在已开启自动轮转时返回。 + * ] + * ] + * "TotalCount" => (integer) 符合条件的总数,不同于 Limit。 + * ] + * + * @return ListKeysResponse + * @throws UCloudException + */ + public function listKeys(ListKeysRequest $request = null) + { + $resp = $this->invoke($request); + return new ListKeysResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * ListScheduleDeletionKeys - 获取计划删除密钥列表,调用ScheduleKeyDeletion命令后进入此列表, 默认30天后正式删除。正式删除前可调用CancelScheduleKeyDeletion恢复 + * + * See also: https://docs.ucloud.cn/api/ukms-api/list_schedule_deletion_keys + * + * Arguments: + * + * $args = [ + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + * "Offset" => (integer) 输出列表起始位置,默认从0开始 + * "Limit" => (integer) 输出列表数量,默认返回200个 + * "OrderBy" => (string) 列表排序方式, 可选项: "-created_time", "created_time","plan_delete_time","-plan_delete_time";默认按-plan_delete_time 计划删除时间升序返回 + * ] + * + * Outputs: + * + * $outputs = [ + * "Objects" => (array) 主密钥信息组成的列表[ + * [ + * "KeyId" => (string) CMK 的唯一标识符 + * "Type" => (string) 密钥类型,仅支持UCloudManagedKeys、CustomerManagedKeys。默认值CustomerManagedKeys + * "Description" => (string) 对密钥的描述说明 + * "Enabled" => (boolean) 是否启用 + * "CreatedTime" => (integer) 创建时间 时间戳 + * "LastModifiedTime" => (integer) 最后修改时间 时间戳 + * "Alias" => (string) 别名,与CMK一一对应 + * "PlanDeleteTime" => (integer) 计划删除时间 时间戳 + * ] + * ] + * "Status" => (string) 操作结果 + * "RequestUuid" => (string) 请求唯一标识符 + * "TotalCount" => (integer) 符合条件的总数, 不同于Limit + * ] + * + * @return ListScheduleDeletionKeysResponse + * @throws UCloudException + */ + public function listScheduleDeletionKeys(ListScheduleDeletionKeysRequest $request = null) + { + $resp = $this->invoke($request); + return new ListScheduleDeletionKeysResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * RotateKeyOnDemand - 立即触发一次密钥轮转。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/rotate_key_on_demand + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * "KeyId" => (string) 密钥 ID。 + * ] + * + * @return RotateKeyOnDemandResponse + * @throws UCloudException + */ + public function rotateKeyOnDemand(RotateKeyOnDemandRequest $request = null) + { + $resp = $this->invoke($request); + return new RotateKeyOnDemandResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * ScheduleKeyDeletion - 计划删除指定密钥。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/schedule_key_deletion + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (integer) 密钥 DB 数字 ID。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return ScheduleKeyDeletionResponse + * @throws UCloudException + */ + public function scheduleKeyDeletion(ScheduleKeyDeletionRequest $request = null) + { + $resp = $this->invoke($request); + return new ScheduleKeyDeletionResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * Sign - 使用非对称密钥对消息或消息摘要签名。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/sign + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥资源长 ID、ARN 或别名。 + * "SigningMessage" => (string) 待签名消息,Base64 编码,最大 4096 字节。 + * "SigningAlgorithm" => (string) 签名算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "MessageType" => (string) 消息类型。可选值:RAW、DIGEST;默认 RAW。 + * ] + * + * Outputs: + * + * $outputs = [ + * "SignatureResult" => (string) 签名结果,Base64 编码。 + * "KeyId" => (string) 密钥资源长 ID。 + * "SigningAlgorithm" => (string) 实际使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * ] + * + * @return SignResponse + * @throws UCloudException + */ + public function sign(SignRequest $request = null) + { + $resp = $this->invoke($request); + return new SignResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UpdateAlias - 将别名更新到另一个密钥。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/update_alias + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "AliasName" => (string) 密钥别名,格式为 alias/name。 + * "KeyId" => (string) 密钥 ID、ARN 或别名。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return UpdateAliasResponse + * @throws UCloudException + */ + public function updateAlias(UpdateAliasRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateAliasResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UpdateKeyDescription - 更新指定密钥的描述信息。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/update_key_description + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "KeyId" => (string) 密钥资源长 ID、ARN 或别名。 + * "Description" => (string) 新的密钥描述,最多 8192 字符;空字符串表示清空描述。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * ] + * + * Outputs: + * + * $outputs = [ + * "Status" => (string) 返回状态。 + * "RequestUuid" => (string) 此次请求唯一标识符。 + * ] + * + * @return UpdateKeyDescriptionResponse + * @throws UCloudException + */ + public function updateKeyDescription(UpdateKeyDescriptionRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateKeyDescriptionResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * Verify - 使用非对称密钥验证签名。 + * + * See also: https://docs.ucloud.cn/api/ukms-api/verify + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。参见地域和可用区列表。 + * "ProjectId" => (string) 项目ID。不填写为默认项目,子账号必须填写。 + * "ResourceId" => (string) UKMS 实例资源 ID。 + * "KeyId" => (string) 密钥 ID、ARN 或别名。 + * "SigningMessage" => (string) 待验签的消息或消息摘要,Base64 编码。 + * "SignatureResult" => (string) 待验证的签名,Base64 编码。 + * "SigningAlgorithm" => (string) 签名时使用的算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。 + * "MessageType" => (string) 消息类型。可选值:RAW、DIGEST;默认 RAW。 + * ] + * + * Outputs: + * + * $outputs = [ + * "KeyId" => (string) 密钥 ID。 + * "SignatureValid" => (boolean) 签名是否有效。 + * "SigningAlgorithm" => (string) 使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。 + * ] + * + * @return VerifyResponse + * @throws UCloudException + */ + public function verify(VerifyRequest $request = null) + { + $resp = $this->invoke($request); + return new VerifyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * VerifyMac - 验证签名 + * + * See also: https://docs.ucloud.cn/api/ukms-api/verify_mac + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "KeyId" => (string) 密钥ID + * "MacMessage" => (string) 用于验证的消息。请输入与生成 HMAC 时所用消息相同的消息。 + * "Mac" => (string) 要验证的 HMAC。请输入由 GenerateMac 操作生成的 HMAC,前提是您指定的消息、HMAC KMS 密钥和 MAC 算法与此请求中指定的值相同。 + * "MacAlgorithm" => (string) 验证过程中将使用的 MAC 算法。请输入与计算 HMAC 时相同的 MAC 算法。此算法必须受 KeyId 参数标识的 HMAC KMS 密钥支持。 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return VerifyMacResponse + * @throws UCloudException + */ + public function verifyMac(VerifyMacRequest $request = null) + { + $resp = $this->invoke($request); + return new VerifyMacResponse($resp->toArray(), $resp->getRequestId()); + } +}