diff --git a/CHANGELOG b/CHANGELOG index b68acdaca..2bc0145d1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-12-31 Version 1.36.228 +- Support asymmetric keys. + 2019-12-31 Version 1.36.227 - Add request parameter groupType for OnsGroupCreate. diff --git a/VERSION b/VERSION index 789ba2fe7..3fde513d7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.227 \ No newline at end of file +1.36.228 \ No newline at end of file diff --git a/kms/CMakeLists.txt b/kms/CMakeLists.txt index 3afd999dc..1cd7f817f 100644 --- a/kms/CMakeLists.txt +++ b/kms/CMakeLists.txt @@ -21,12 +21,22 @@ set(kms_public_header include/alibabacloud/kms/KmsExport.h ) set(kms_public_header_model + include/alibabacloud/kms/model/AsymmetricDecryptRequest.h + include/alibabacloud/kms/model/AsymmetricDecryptResult.h + include/alibabacloud/kms/model/AsymmetricEncryptRequest.h + include/alibabacloud/kms/model/AsymmetricEncryptResult.h + include/alibabacloud/kms/model/AsymmetricSignRequest.h + include/alibabacloud/kms/model/AsymmetricSignResult.h + include/alibabacloud/kms/model/AsymmetricVerifyRequest.h + include/alibabacloud/kms/model/AsymmetricVerifyResult.h include/alibabacloud/kms/model/CancelKeyDeletionRequest.h include/alibabacloud/kms/model/CancelKeyDeletionResult.h include/alibabacloud/kms/model/CreateAliasRequest.h include/alibabacloud/kms/model/CreateAliasResult.h include/alibabacloud/kms/model/CreateKeyRequest.h include/alibabacloud/kms/model/CreateKeyResult.h + include/alibabacloud/kms/model/CreateKeyVersionRequest.h + include/alibabacloud/kms/model/CreateKeyVersionResult.h include/alibabacloud/kms/model/DecryptRequest.h include/alibabacloud/kms/model/DecryptResult.h include/alibabacloud/kms/model/DeleteAliasRequest.h @@ -53,6 +63,8 @@ set(kms_public_header_model include/alibabacloud/kms/model/GenerateDataKeyWithoutPlaintextResult.h include/alibabacloud/kms/model/GetParametersForImportRequest.h include/alibabacloud/kms/model/GetParametersForImportResult.h + include/alibabacloud/kms/model/GetPublicKeyRequest.h + include/alibabacloud/kms/model/GetPublicKeyResult.h include/alibabacloud/kms/model/ImportKeyMaterialRequest.h include/alibabacloud/kms/model/ImportKeyMaterialResult.h include/alibabacloud/kms/model/ListAliasesRequest.h @@ -80,12 +92,22 @@ set(kms_public_header_model set(kms_src src/KmsClient.cc + src/model/AsymmetricDecryptRequest.cc + src/model/AsymmetricDecryptResult.cc + src/model/AsymmetricEncryptRequest.cc + src/model/AsymmetricEncryptResult.cc + src/model/AsymmetricSignRequest.cc + src/model/AsymmetricSignResult.cc + src/model/AsymmetricVerifyRequest.cc + src/model/AsymmetricVerifyResult.cc src/model/CancelKeyDeletionRequest.cc src/model/CancelKeyDeletionResult.cc src/model/CreateAliasRequest.cc src/model/CreateAliasResult.cc src/model/CreateKeyRequest.cc src/model/CreateKeyResult.cc + src/model/CreateKeyVersionRequest.cc + src/model/CreateKeyVersionResult.cc src/model/DecryptRequest.cc src/model/DecryptResult.cc src/model/DeleteAliasRequest.cc @@ -112,6 +134,8 @@ set(kms_src src/model/GenerateDataKeyWithoutPlaintextResult.cc src/model/GetParametersForImportRequest.cc src/model/GetParametersForImportResult.cc + src/model/GetPublicKeyRequest.cc + src/model/GetPublicKeyResult.cc src/model/ImportKeyMaterialRequest.cc src/model/ImportKeyMaterialResult.cc src/model/ListAliasesRequest.cc diff --git a/kms/include/alibabacloud/kms/KmsClient.h b/kms/include/alibabacloud/kms/KmsClient.h index ecdfee942..26434a686 100644 --- a/kms/include/alibabacloud/kms/KmsClient.h +++ b/kms/include/alibabacloud/kms/KmsClient.h @@ -22,12 +22,22 @@ #include #include #include "KmsExport.h" +#include "model/AsymmetricDecryptRequest.h" +#include "model/AsymmetricDecryptResult.h" +#include "model/AsymmetricEncryptRequest.h" +#include "model/AsymmetricEncryptResult.h" +#include "model/AsymmetricSignRequest.h" +#include "model/AsymmetricSignResult.h" +#include "model/AsymmetricVerifyRequest.h" +#include "model/AsymmetricVerifyResult.h" #include "model/CancelKeyDeletionRequest.h" #include "model/CancelKeyDeletionResult.h" #include "model/CreateAliasRequest.h" #include "model/CreateAliasResult.h" #include "model/CreateKeyRequest.h" #include "model/CreateKeyResult.h" +#include "model/CreateKeyVersionRequest.h" +#include "model/CreateKeyVersionResult.h" #include "model/DecryptRequest.h" #include "model/DecryptResult.h" #include "model/DeleteAliasRequest.h" @@ -54,6 +64,8 @@ #include "model/GenerateDataKeyWithoutPlaintextResult.h" #include "model/GetParametersForImportRequest.h" #include "model/GetParametersForImportResult.h" +#include "model/GetPublicKeyRequest.h" +#include "model/GetPublicKeyResult.h" #include "model/ImportKeyMaterialRequest.h" #include "model/ImportKeyMaterialResult.h" #include "model/ListAliasesRequest.h" @@ -87,6 +99,18 @@ namespace AlibabaCloud class ALIBABACLOUD_KMS_EXPORT KmsClient : public RpcServiceClient { public: + typedef Outcome AsymmetricDecryptOutcome; + typedef std::future AsymmetricDecryptOutcomeCallable; + typedef std::function&)> AsymmetricDecryptAsyncHandler; + typedef Outcome AsymmetricEncryptOutcome; + typedef std::future AsymmetricEncryptOutcomeCallable; + typedef std::function&)> AsymmetricEncryptAsyncHandler; + typedef Outcome AsymmetricSignOutcome; + typedef std::future AsymmetricSignOutcomeCallable; + typedef std::function&)> AsymmetricSignAsyncHandler; + typedef Outcome AsymmetricVerifyOutcome; + typedef std::future AsymmetricVerifyOutcomeCallable; + typedef std::function&)> AsymmetricVerifyAsyncHandler; typedef Outcome CancelKeyDeletionOutcome; typedef std::future CancelKeyDeletionOutcomeCallable; typedef std::function&)> CancelKeyDeletionAsyncHandler; @@ -96,6 +120,9 @@ namespace AlibabaCloud typedef Outcome CreateKeyOutcome; typedef std::future CreateKeyOutcomeCallable; typedef std::function&)> CreateKeyAsyncHandler; + typedef Outcome CreateKeyVersionOutcome; + typedef std::future CreateKeyVersionOutcomeCallable; + typedef std::function&)> CreateKeyVersionAsyncHandler; typedef Outcome DecryptOutcome; typedef std::future DecryptOutcomeCallable; typedef std::function&)> DecryptAsyncHandler; @@ -135,6 +162,9 @@ namespace AlibabaCloud typedef Outcome GetParametersForImportOutcome; typedef std::future GetParametersForImportOutcomeCallable; typedef std::function&)> GetParametersForImportAsyncHandler; + typedef Outcome GetPublicKeyOutcome; + typedef std::future GetPublicKeyOutcomeCallable; + typedef std::function&)> GetPublicKeyAsyncHandler; typedef Outcome ImportKeyMaterialOutcome; typedef std::future ImportKeyMaterialOutcomeCallable; typedef std::function&)> ImportKeyMaterialAsyncHandler; @@ -176,6 +206,18 @@ namespace AlibabaCloud KmsClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); KmsClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); ~KmsClient(); + AsymmetricDecryptOutcome asymmetricDecrypt(const Model::AsymmetricDecryptRequest &request)const; + void asymmetricDecryptAsync(const Model::AsymmetricDecryptRequest& request, const AsymmetricDecryptAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + AsymmetricDecryptOutcomeCallable asymmetricDecryptCallable(const Model::AsymmetricDecryptRequest& request) const; + AsymmetricEncryptOutcome asymmetricEncrypt(const Model::AsymmetricEncryptRequest &request)const; + void asymmetricEncryptAsync(const Model::AsymmetricEncryptRequest& request, const AsymmetricEncryptAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + AsymmetricEncryptOutcomeCallable asymmetricEncryptCallable(const Model::AsymmetricEncryptRequest& request) const; + AsymmetricSignOutcome asymmetricSign(const Model::AsymmetricSignRequest &request)const; + void asymmetricSignAsync(const Model::AsymmetricSignRequest& request, const AsymmetricSignAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + AsymmetricSignOutcomeCallable asymmetricSignCallable(const Model::AsymmetricSignRequest& request) const; + AsymmetricVerifyOutcome asymmetricVerify(const Model::AsymmetricVerifyRequest &request)const; + void asymmetricVerifyAsync(const Model::AsymmetricVerifyRequest& request, const AsymmetricVerifyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + AsymmetricVerifyOutcomeCallable asymmetricVerifyCallable(const Model::AsymmetricVerifyRequest& request) const; CancelKeyDeletionOutcome cancelKeyDeletion(const Model::CancelKeyDeletionRequest &request)const; void cancelKeyDeletionAsync(const Model::CancelKeyDeletionRequest& request, const CancelKeyDeletionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CancelKeyDeletionOutcomeCallable cancelKeyDeletionCallable(const Model::CancelKeyDeletionRequest& request) const; @@ -185,6 +227,9 @@ namespace AlibabaCloud CreateKeyOutcome createKey(const Model::CreateKeyRequest &request)const; void createKeyAsync(const Model::CreateKeyRequest& request, const CreateKeyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateKeyOutcomeCallable createKeyCallable(const Model::CreateKeyRequest& request) const; + CreateKeyVersionOutcome createKeyVersion(const Model::CreateKeyVersionRequest &request)const; + void createKeyVersionAsync(const Model::CreateKeyVersionRequest& request, const CreateKeyVersionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateKeyVersionOutcomeCallable createKeyVersionCallable(const Model::CreateKeyVersionRequest& request) const; DecryptOutcome decrypt(const Model::DecryptRequest &request)const; void decryptAsync(const Model::DecryptRequest& request, const DecryptAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DecryptOutcomeCallable decryptCallable(const Model::DecryptRequest& request) const; @@ -224,6 +269,9 @@ namespace AlibabaCloud GetParametersForImportOutcome getParametersForImport(const Model::GetParametersForImportRequest &request)const; void getParametersForImportAsync(const Model::GetParametersForImportRequest& request, const GetParametersForImportAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetParametersForImportOutcomeCallable getParametersForImportCallable(const Model::GetParametersForImportRequest& request) const; + GetPublicKeyOutcome getPublicKey(const Model::GetPublicKeyRequest &request)const; + void getPublicKeyAsync(const Model::GetPublicKeyRequest& request, const GetPublicKeyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetPublicKeyOutcomeCallable getPublicKeyCallable(const Model::GetPublicKeyRequest& request) const; ImportKeyMaterialOutcome importKeyMaterial(const Model::ImportKeyMaterialRequest &request)const; void importKeyMaterialAsync(const Model::ImportKeyMaterialRequest& request, const ImportKeyMaterialAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ImportKeyMaterialOutcomeCallable importKeyMaterialCallable(const Model::ImportKeyMaterialRequest& request) const; diff --git a/kms/include/alibabacloud/kms/model/AsymmetricDecryptRequest.h b/kms/include/alibabacloud/kms/model/AsymmetricDecryptRequest.h new file mode 100644 index 000000000..4205c46fb --- /dev/null +++ b/kms/include/alibabacloud/kms/model/AsymmetricDecryptRequest.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_ASYMMETRICDECRYPTREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_ASYMMETRICDECRYPTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT AsymmetricDecryptRequest : public RpcServiceRequest + { + + public: + AsymmetricDecryptRequest(); + ~AsymmetricDecryptRequest(); + + std::string getKeyVersionId()const; + void setKeyVersionId(const std::string& keyVersionId); + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + std::string getCiphertextBlob()const; + void setCiphertextBlob(const std::string& ciphertextBlob); + std::string getAlgorithm()const; + void setAlgorithm(const std::string& algorithm); + + private: + std::string keyVersionId_; + std::string keyId_; + std::string ciphertextBlob_; + std::string algorithm_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ASYMMETRICDECRYPTREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/AsymmetricDecryptResult.h b/kms/include/alibabacloud/kms/model/AsymmetricDecryptResult.h new file mode 100644 index 000000000..434c2b681 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/AsymmetricDecryptResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_ASYMMETRICDECRYPTRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_ASYMMETRICDECRYPTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT AsymmetricDecryptResult : public ServiceResult + { + public: + + + AsymmetricDecryptResult(); + explicit AsymmetricDecryptResult(const std::string &payload); + ~AsymmetricDecryptResult(); + std::string getPlaintext()const; + std::string getKeyId()const; + std::string getKeyVersionId()const; + + protected: + void parse(const std::string &payload); + private: + std::string plaintext_; + std::string keyId_; + std::string keyVersionId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ASYMMETRICDECRYPTRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/AsymmetricEncryptRequest.h b/kms/include/alibabacloud/kms/model/AsymmetricEncryptRequest.h new file mode 100644 index 000000000..061ee8732 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/AsymmetricEncryptRequest.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_ASYMMETRICENCRYPTREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_ASYMMETRICENCRYPTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT AsymmetricEncryptRequest : public RpcServiceRequest + { + + public: + AsymmetricEncryptRequest(); + ~AsymmetricEncryptRequest(); + + std::string getKeyVersionId()const; + void setKeyVersionId(const std::string& keyVersionId); + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + std::string getPlaintext()const; + void setPlaintext(const std::string& plaintext); + std::string getAlgorithm()const; + void setAlgorithm(const std::string& algorithm); + + private: + std::string keyVersionId_; + std::string keyId_; + std::string plaintext_; + std::string algorithm_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ASYMMETRICENCRYPTREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/AsymmetricEncryptResult.h b/kms/include/alibabacloud/kms/model/AsymmetricEncryptResult.h new file mode 100644 index 000000000..1a365dc65 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/AsymmetricEncryptResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_ASYMMETRICENCRYPTRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_ASYMMETRICENCRYPTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT AsymmetricEncryptResult : public ServiceResult + { + public: + + + AsymmetricEncryptResult(); + explicit AsymmetricEncryptResult(const std::string &payload); + ~AsymmetricEncryptResult(); + std::string getCiphertextBlob()const; + std::string getKeyId()const; + std::string getKeyVersionId()const; + + protected: + void parse(const std::string &payload); + private: + std::string ciphertextBlob_; + std::string keyId_; + std::string keyVersionId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ASYMMETRICENCRYPTRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/AsymmetricSignRequest.h b/kms/include/alibabacloud/kms/model/AsymmetricSignRequest.h new file mode 100644 index 000000000..cbda1d73a --- /dev/null +++ b/kms/include/alibabacloud/kms/model/AsymmetricSignRequest.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_ASYMMETRICSIGNREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_ASYMMETRICSIGNREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT AsymmetricSignRequest : public RpcServiceRequest + { + + public: + AsymmetricSignRequest(); + ~AsymmetricSignRequest(); + + std::string getKeyVersionId()const; + void setKeyVersionId(const std::string& keyVersionId); + std::string getDigest()const; + void setDigest(const std::string& digest); + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + std::string getAlgorithm()const; + void setAlgorithm(const std::string& algorithm); + + private: + std::string keyVersionId_; + std::string digest_; + std::string keyId_; + std::string algorithm_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ASYMMETRICSIGNREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/AsymmetricSignResult.h b/kms/include/alibabacloud/kms/model/AsymmetricSignResult.h new file mode 100644 index 000000000..e189d6ca0 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/AsymmetricSignResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_ASYMMETRICSIGNRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_ASYMMETRICSIGNRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT AsymmetricSignResult : public ServiceResult + { + public: + + + AsymmetricSignResult(); + explicit AsymmetricSignResult(const std::string &payload); + ~AsymmetricSignResult(); + std::string getValue()const; + std::string getKeyId()const; + std::string getKeyVersionId()const; + + protected: + void parse(const std::string &payload); + private: + std::string value_; + std::string keyId_; + std::string keyVersionId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ASYMMETRICSIGNRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/AsymmetricVerifyRequest.h b/kms/include/alibabacloud/kms/model/AsymmetricVerifyRequest.h new file mode 100644 index 000000000..5b88cc25d --- /dev/null +++ b/kms/include/alibabacloud/kms/model/AsymmetricVerifyRequest.h @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_ASYMMETRICVERIFYREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_ASYMMETRICVERIFYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT AsymmetricVerifyRequest : public RpcServiceRequest + { + + public: + AsymmetricVerifyRequest(); + ~AsymmetricVerifyRequest(); + + std::string getKeyVersionId()const; + void setKeyVersionId(const std::string& keyVersionId); + std::string getDigest()const; + void setDigest(const std::string& digest); + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + std::string getValue()const; + void setValue(const std::string& value); + std::string getAlgorithm()const; + void setAlgorithm(const std::string& algorithm); + + private: + std::string keyVersionId_; + std::string digest_; + std::string keyId_; + std::string value_; + std::string algorithm_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ASYMMETRICVERIFYREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/AsymmetricVerifyResult.h b/kms/include/alibabacloud/kms/model/AsymmetricVerifyResult.h new file mode 100644 index 000000000..72b04d067 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/AsymmetricVerifyResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_ASYMMETRICVERIFYRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_ASYMMETRICVERIFYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT AsymmetricVerifyResult : public ServiceResult + { + public: + + + AsymmetricVerifyResult(); + explicit AsymmetricVerifyResult(const std::string &payload); + ~AsymmetricVerifyResult(); + bool getValue()const; + std::string getKeyId()const; + std::string getKeyVersionId()const; + + protected: + void parse(const std::string &payload); + private: + bool value_; + std::string keyId_; + std::string keyVersionId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_ASYMMETRICVERIFYRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/CreateKeyRequest.h b/kms/include/alibabacloud/kms/model/CreateKeyRequest.h index ed2e22dc6..a23569a9a 100644 --- a/kms/include/alibabacloud/kms/model/CreateKeyRequest.h +++ b/kms/include/alibabacloud/kms/model/CreateKeyRequest.h @@ -43,6 +43,8 @@ namespace AlibabaCloud void setOrigin(const std::string& origin); std::string getDescription()const; void setDescription(const std::string& description); + std::string getKeySpec()const; + void setKeySpec(const std::string& keySpec); std::string getRotationInterval()const; void setRotationInterval(const std::string& rotationInterval); bool getEnableAutomaticRotation()const; @@ -53,6 +55,7 @@ namespace AlibabaCloud std::string keyUsage_; std::string origin_; std::string description_; + std::string keySpec_; std::string rotationInterval_; bool enableAutomaticRotation_; diff --git a/kms/include/alibabacloud/kms/model/CreateKeyResult.h b/kms/include/alibabacloud/kms/model/CreateKeyResult.h index 941024546..2ea8f7705 100644 --- a/kms/include/alibabacloud/kms/model/CreateKeyResult.h +++ b/kms/include/alibabacloud/kms/model/CreateKeyResult.h @@ -40,6 +40,7 @@ namespace AlibabaCloud std::string description; std::string lastRotationDate; std::string rotationInterval; + std::string keySpec; std::string keyUsage; std::string keyId; std::string primaryKeyVersion; diff --git a/kms/include/alibabacloud/kms/model/CreateKeyVersionRequest.h b/kms/include/alibabacloud/kms/model/CreateKeyVersionRequest.h new file mode 100644 index 000000000..1a8ec66e5 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/CreateKeyVersionRequest.h @@ -0,0 +1,48 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_CREATEKEYVERSIONREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_CREATEKEYVERSIONREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT CreateKeyVersionRequest : public RpcServiceRequest + { + + public: + CreateKeyVersionRequest(); + ~CreateKeyVersionRequest(); + + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + + private: + std::string keyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_CREATEKEYVERSIONREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/CreateKeyVersionResult.h b/kms/include/alibabacloud/kms/model/CreateKeyVersionResult.h new file mode 100644 index 000000000..3453a5b09 --- /dev/null +++ b/kms/include/alibabacloud/kms/model/CreateKeyVersionResult.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_CREATEKEYVERSIONRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_CREATEKEYVERSIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT CreateKeyVersionResult : public ServiceResult + { + public: + struct KeyVersion + { + std::string creationDate; + std::string keyId; + std::string keyVersionId; + }; + + + CreateKeyVersionResult(); + explicit CreateKeyVersionResult(const std::string &payload); + ~CreateKeyVersionResult(); + KeyVersion getKeyVersion()const; + + protected: + void parse(const std::string &payload); + private: + KeyVersion keyVersion_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_CREATEKEYVERSIONRESULT_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/DescribeKeyResult.h b/kms/include/alibabacloud/kms/model/DescribeKeyResult.h index e01ad8d81..9601af1f6 100644 --- a/kms/include/alibabacloud/kms/model/DescribeKeyResult.h +++ b/kms/include/alibabacloud/kms/model/DescribeKeyResult.h @@ -40,6 +40,7 @@ namespace AlibabaCloud std::string description; std::string lastRotationDate; std::string rotationInterval; + std::string keySpec; std::string keyUsage; std::string keyId; std::string primaryKeyVersion; diff --git a/kms/include/alibabacloud/kms/model/GetPublicKeyRequest.h b/kms/include/alibabacloud/kms/model/GetPublicKeyRequest.h new file mode 100644 index 000000000..1fb720abf --- /dev/null +++ b/kms/include/alibabacloud/kms/model/GetPublicKeyRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_GETPUBLICKEYREQUEST_H_ +#define ALIBABACLOUD_KMS_MODEL_GETPUBLICKEYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT GetPublicKeyRequest : public RpcServiceRequest + { + + public: + GetPublicKeyRequest(); + ~GetPublicKeyRequest(); + + std::string getKeyVersionId()const; + void setKeyVersionId(const std::string& keyVersionId); + std::string getKeyId()const; + void setKeyId(const std::string& keyId); + + private: + std::string keyVersionId_; + std::string keyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_GETPUBLICKEYREQUEST_H_ \ No newline at end of file diff --git a/kms/include/alibabacloud/kms/model/GetPublicKeyResult.h b/kms/include/alibabacloud/kms/model/GetPublicKeyResult.h new file mode 100644 index 000000000..d5dbb022c --- /dev/null +++ b/kms/include/alibabacloud/kms/model/GetPublicKeyResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_KMS_MODEL_GETPUBLICKEYRESULT_H_ +#define ALIBABACLOUD_KMS_MODEL_GETPUBLICKEYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Kms + { + namespace Model + { + class ALIBABACLOUD_KMS_EXPORT GetPublicKeyResult : public ServiceResult + { + public: + + + GetPublicKeyResult(); + explicit GetPublicKeyResult(const std::string &payload); + ~GetPublicKeyResult(); + std::string getPublicKey()const; + std::string getKeyId()const; + std::string getKeyVersionId()const; + + protected: + void parse(const std::string &payload); + private: + std::string publicKey_; + std::string keyId_; + std::string keyVersionId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_KMS_MODEL_GETPUBLICKEYRESULT_H_ \ No newline at end of file diff --git a/kms/src/KmsClient.cc b/kms/src/KmsClient.cc index 5a28b9a2e..8143304e2 100644 --- a/kms/src/KmsClient.cc +++ b/kms/src/KmsClient.cc @@ -51,6 +51,150 @@ KmsClient::KmsClient(const std::string & accessKeyId, const std::string & access KmsClient::~KmsClient() {} +KmsClient::AsymmetricDecryptOutcome KmsClient::asymmetricDecrypt(const AsymmetricDecryptRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return AsymmetricDecryptOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return AsymmetricDecryptOutcome(AsymmetricDecryptResult(outcome.result())); + else + return AsymmetricDecryptOutcome(outcome.error()); +} + +void KmsClient::asymmetricDecryptAsync(const AsymmetricDecryptRequest& request, const AsymmetricDecryptAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, asymmetricDecrypt(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::AsymmetricDecryptOutcomeCallable KmsClient::asymmetricDecryptCallable(const AsymmetricDecryptRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->asymmetricDecrypt(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +KmsClient::AsymmetricEncryptOutcome KmsClient::asymmetricEncrypt(const AsymmetricEncryptRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return AsymmetricEncryptOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return AsymmetricEncryptOutcome(AsymmetricEncryptResult(outcome.result())); + else + return AsymmetricEncryptOutcome(outcome.error()); +} + +void KmsClient::asymmetricEncryptAsync(const AsymmetricEncryptRequest& request, const AsymmetricEncryptAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, asymmetricEncrypt(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::AsymmetricEncryptOutcomeCallable KmsClient::asymmetricEncryptCallable(const AsymmetricEncryptRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->asymmetricEncrypt(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +KmsClient::AsymmetricSignOutcome KmsClient::asymmetricSign(const AsymmetricSignRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return AsymmetricSignOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return AsymmetricSignOutcome(AsymmetricSignResult(outcome.result())); + else + return AsymmetricSignOutcome(outcome.error()); +} + +void KmsClient::asymmetricSignAsync(const AsymmetricSignRequest& request, const AsymmetricSignAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, asymmetricSign(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::AsymmetricSignOutcomeCallable KmsClient::asymmetricSignCallable(const AsymmetricSignRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->asymmetricSign(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +KmsClient::AsymmetricVerifyOutcome KmsClient::asymmetricVerify(const AsymmetricVerifyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return AsymmetricVerifyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return AsymmetricVerifyOutcome(AsymmetricVerifyResult(outcome.result())); + else + return AsymmetricVerifyOutcome(outcome.error()); +} + +void KmsClient::asymmetricVerifyAsync(const AsymmetricVerifyRequest& request, const AsymmetricVerifyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, asymmetricVerify(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::AsymmetricVerifyOutcomeCallable KmsClient::asymmetricVerifyCallable(const AsymmetricVerifyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->asymmetricVerify(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::CancelKeyDeletionOutcome KmsClient::cancelKeyDeletion(const CancelKeyDeletionRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -159,6 +303,42 @@ KmsClient::CreateKeyOutcomeCallable KmsClient::createKeyCallable(const CreateKey return task->get_future(); } +KmsClient::CreateKeyVersionOutcome KmsClient::createKeyVersion(const CreateKeyVersionRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateKeyVersionOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateKeyVersionOutcome(CreateKeyVersionResult(outcome.result())); + else + return CreateKeyVersionOutcome(outcome.error()); +} + +void KmsClient::createKeyVersionAsync(const CreateKeyVersionRequest& request, const CreateKeyVersionAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createKeyVersion(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::CreateKeyVersionOutcomeCallable KmsClient::createKeyVersionCallable(const CreateKeyVersionRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createKeyVersion(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::DecryptOutcome KmsClient::decrypt(const DecryptRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -627,6 +807,42 @@ KmsClient::GetParametersForImportOutcomeCallable KmsClient::getParametersForImpo return task->get_future(); } +KmsClient::GetPublicKeyOutcome KmsClient::getPublicKey(const GetPublicKeyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetPublicKeyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetPublicKeyOutcome(GetPublicKeyResult(outcome.result())); + else + return GetPublicKeyOutcome(outcome.error()); +} + +void KmsClient::getPublicKeyAsync(const GetPublicKeyRequest& request, const GetPublicKeyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getPublicKey(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +KmsClient::GetPublicKeyOutcomeCallable KmsClient::getPublicKeyCallable(const GetPublicKeyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getPublicKey(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + KmsClient::ImportKeyMaterialOutcome KmsClient::importKeyMaterial(const ImportKeyMaterialRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/kms/src/model/AsymmetricDecryptRequest.cc b/kms/src/model/AsymmetricDecryptRequest.cc new file mode 100644 index 000000000..dfbf4a8c4 --- /dev/null +++ b/kms/src/model/AsymmetricDecryptRequest.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Kms::Model::AsymmetricDecryptRequest; + +AsymmetricDecryptRequest::AsymmetricDecryptRequest() : + RpcServiceRequest("kms", "2016-01-20", "AsymmetricDecrypt") +{ + setMethod(HttpRequest::Method::Post); +} + +AsymmetricDecryptRequest::~AsymmetricDecryptRequest() +{} + +std::string AsymmetricDecryptRequest::getKeyVersionId()const +{ + return keyVersionId_; +} + +void AsymmetricDecryptRequest::setKeyVersionId(const std::string& keyVersionId) +{ + keyVersionId_ = keyVersionId; + setCoreParameter("KeyVersionId", keyVersionId); +} + +std::string AsymmetricDecryptRequest::getKeyId()const +{ + return keyId_; +} + +void AsymmetricDecryptRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + +std::string AsymmetricDecryptRequest::getCiphertextBlob()const +{ + return ciphertextBlob_; +} + +void AsymmetricDecryptRequest::setCiphertextBlob(const std::string& ciphertextBlob) +{ + ciphertextBlob_ = ciphertextBlob; + setCoreParameter("CiphertextBlob", ciphertextBlob); +} + +std::string AsymmetricDecryptRequest::getAlgorithm()const +{ + return algorithm_; +} + +void AsymmetricDecryptRequest::setAlgorithm(const std::string& algorithm) +{ + algorithm_ = algorithm; + setCoreParameter("Algorithm", algorithm); +} + diff --git a/kms/src/model/AsymmetricDecryptResult.cc b/kms/src/model/AsymmetricDecryptResult.cc new file mode 100644 index 000000000..570cc42d0 --- /dev/null +++ b/kms/src/model/AsymmetricDecryptResult.cc @@ -0,0 +1,65 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Kms; +using namespace AlibabaCloud::Kms::Model; + +AsymmetricDecryptResult::AsymmetricDecryptResult() : + ServiceResult() +{} + +AsymmetricDecryptResult::AsymmetricDecryptResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +AsymmetricDecryptResult::~AsymmetricDecryptResult() +{} + +void AsymmetricDecryptResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Plaintext"].isNull()) + plaintext_ = value["Plaintext"].asString(); + if(!value["KeyId"].isNull()) + keyId_ = value["KeyId"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); + +} + +std::string AsymmetricDecryptResult::getPlaintext()const +{ + return plaintext_; +} + +std::string AsymmetricDecryptResult::getKeyId()const +{ + return keyId_; +} + +std::string AsymmetricDecryptResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/AsymmetricEncryptRequest.cc b/kms/src/model/AsymmetricEncryptRequest.cc new file mode 100644 index 000000000..13a8ac619 --- /dev/null +++ b/kms/src/model/AsymmetricEncryptRequest.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Kms::Model::AsymmetricEncryptRequest; + +AsymmetricEncryptRequest::AsymmetricEncryptRequest() : + RpcServiceRequest("kms", "2016-01-20", "AsymmetricEncrypt") +{ + setMethod(HttpRequest::Method::Post); +} + +AsymmetricEncryptRequest::~AsymmetricEncryptRequest() +{} + +std::string AsymmetricEncryptRequest::getKeyVersionId()const +{ + return keyVersionId_; +} + +void AsymmetricEncryptRequest::setKeyVersionId(const std::string& keyVersionId) +{ + keyVersionId_ = keyVersionId; + setCoreParameter("KeyVersionId", keyVersionId); +} + +std::string AsymmetricEncryptRequest::getKeyId()const +{ + return keyId_; +} + +void AsymmetricEncryptRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + +std::string AsymmetricEncryptRequest::getPlaintext()const +{ + return plaintext_; +} + +void AsymmetricEncryptRequest::setPlaintext(const std::string& plaintext) +{ + plaintext_ = plaintext; + setCoreParameter("Plaintext", plaintext); +} + +std::string AsymmetricEncryptRequest::getAlgorithm()const +{ + return algorithm_; +} + +void AsymmetricEncryptRequest::setAlgorithm(const std::string& algorithm) +{ + algorithm_ = algorithm; + setCoreParameter("Algorithm", algorithm); +} + diff --git a/kms/src/model/AsymmetricEncryptResult.cc b/kms/src/model/AsymmetricEncryptResult.cc new file mode 100644 index 000000000..a5dadb6c7 --- /dev/null +++ b/kms/src/model/AsymmetricEncryptResult.cc @@ -0,0 +1,65 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Kms; +using namespace AlibabaCloud::Kms::Model; + +AsymmetricEncryptResult::AsymmetricEncryptResult() : + ServiceResult() +{} + +AsymmetricEncryptResult::AsymmetricEncryptResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +AsymmetricEncryptResult::~AsymmetricEncryptResult() +{} + +void AsymmetricEncryptResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["CiphertextBlob"].isNull()) + ciphertextBlob_ = value["CiphertextBlob"].asString(); + if(!value["KeyId"].isNull()) + keyId_ = value["KeyId"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); + +} + +std::string AsymmetricEncryptResult::getCiphertextBlob()const +{ + return ciphertextBlob_; +} + +std::string AsymmetricEncryptResult::getKeyId()const +{ + return keyId_; +} + +std::string AsymmetricEncryptResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/AsymmetricSignRequest.cc b/kms/src/model/AsymmetricSignRequest.cc new file mode 100644 index 000000000..8668e2e59 --- /dev/null +++ b/kms/src/model/AsymmetricSignRequest.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Kms::Model::AsymmetricSignRequest; + +AsymmetricSignRequest::AsymmetricSignRequest() : + RpcServiceRequest("kms", "2016-01-20", "AsymmetricSign") +{ + setMethod(HttpRequest::Method::Post); +} + +AsymmetricSignRequest::~AsymmetricSignRequest() +{} + +std::string AsymmetricSignRequest::getKeyVersionId()const +{ + return keyVersionId_; +} + +void AsymmetricSignRequest::setKeyVersionId(const std::string& keyVersionId) +{ + keyVersionId_ = keyVersionId; + setCoreParameter("KeyVersionId", keyVersionId); +} + +std::string AsymmetricSignRequest::getDigest()const +{ + return digest_; +} + +void AsymmetricSignRequest::setDigest(const std::string& digest) +{ + digest_ = digest; + setCoreParameter("Digest", digest); +} + +std::string AsymmetricSignRequest::getKeyId()const +{ + return keyId_; +} + +void AsymmetricSignRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + +std::string AsymmetricSignRequest::getAlgorithm()const +{ + return algorithm_; +} + +void AsymmetricSignRequest::setAlgorithm(const std::string& algorithm) +{ + algorithm_ = algorithm; + setCoreParameter("Algorithm", algorithm); +} + diff --git a/kms/src/model/AsymmetricSignResult.cc b/kms/src/model/AsymmetricSignResult.cc new file mode 100644 index 000000000..10b52810c --- /dev/null +++ b/kms/src/model/AsymmetricSignResult.cc @@ -0,0 +1,65 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Kms; +using namespace AlibabaCloud::Kms::Model; + +AsymmetricSignResult::AsymmetricSignResult() : + ServiceResult() +{} + +AsymmetricSignResult::AsymmetricSignResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +AsymmetricSignResult::~AsymmetricSignResult() +{} + +void AsymmetricSignResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Value"].isNull()) + value_ = value["Value"].asString(); + if(!value["KeyId"].isNull()) + keyId_ = value["KeyId"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); + +} + +std::string AsymmetricSignResult::getValue()const +{ + return value_; +} + +std::string AsymmetricSignResult::getKeyId()const +{ + return keyId_; +} + +std::string AsymmetricSignResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/AsymmetricVerifyRequest.cc b/kms/src/model/AsymmetricVerifyRequest.cc new file mode 100644 index 000000000..d9e46f4a2 --- /dev/null +++ b/kms/src/model/AsymmetricVerifyRequest.cc @@ -0,0 +1,84 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Kms::Model::AsymmetricVerifyRequest; + +AsymmetricVerifyRequest::AsymmetricVerifyRequest() : + RpcServiceRequest("kms", "2016-01-20", "AsymmetricVerify") +{ + setMethod(HttpRequest::Method::Post); +} + +AsymmetricVerifyRequest::~AsymmetricVerifyRequest() +{} + +std::string AsymmetricVerifyRequest::getKeyVersionId()const +{ + return keyVersionId_; +} + +void AsymmetricVerifyRequest::setKeyVersionId(const std::string& keyVersionId) +{ + keyVersionId_ = keyVersionId; + setCoreParameter("KeyVersionId", keyVersionId); +} + +std::string AsymmetricVerifyRequest::getDigest()const +{ + return digest_; +} + +void AsymmetricVerifyRequest::setDigest(const std::string& digest) +{ + digest_ = digest; + setCoreParameter("Digest", digest); +} + +std::string AsymmetricVerifyRequest::getKeyId()const +{ + return keyId_; +} + +void AsymmetricVerifyRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + +std::string AsymmetricVerifyRequest::getValue()const +{ + return value_; +} + +void AsymmetricVerifyRequest::setValue(const std::string& value) +{ + value_ = value; + setCoreParameter("Value", value); +} + +std::string AsymmetricVerifyRequest::getAlgorithm()const +{ + return algorithm_; +} + +void AsymmetricVerifyRequest::setAlgorithm(const std::string& algorithm) +{ + algorithm_ = algorithm; + setCoreParameter("Algorithm", algorithm); +} + diff --git a/kms/src/model/AsymmetricVerifyResult.cc b/kms/src/model/AsymmetricVerifyResult.cc new file mode 100644 index 000000000..f1376184e --- /dev/null +++ b/kms/src/model/AsymmetricVerifyResult.cc @@ -0,0 +1,65 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Kms; +using namespace AlibabaCloud::Kms::Model; + +AsymmetricVerifyResult::AsymmetricVerifyResult() : + ServiceResult() +{} + +AsymmetricVerifyResult::AsymmetricVerifyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +AsymmetricVerifyResult::~AsymmetricVerifyResult() +{} + +void AsymmetricVerifyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Value"].isNull()) + value_ = value["Value"].asString() == "true"; + if(!value["KeyId"].isNull()) + keyId_ = value["KeyId"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); + +} + +bool AsymmetricVerifyResult::getValue()const +{ + return value_; +} + +std::string AsymmetricVerifyResult::getKeyId()const +{ + return keyId_; +} + +std::string AsymmetricVerifyResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/CancelKeyDeletionRequest.cc b/kms/src/model/CancelKeyDeletionRequest.cc index 04cd74f7c..c65e320df 100644 --- a/kms/src/model/CancelKeyDeletionRequest.cc +++ b/kms/src/model/CancelKeyDeletionRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::CancelKeyDeletionRequest; CancelKeyDeletionRequest::CancelKeyDeletionRequest() : RpcServiceRequest("kms", "2016-01-20", "CancelKeyDeletion") -{} +{ + setMethod(HttpRequest::Method::Post); +} CancelKeyDeletionRequest::~CancelKeyDeletionRequest() {} diff --git a/kms/src/model/CreateAliasRequest.cc b/kms/src/model/CreateAliasRequest.cc index 3ae463201..1e3444a32 100644 --- a/kms/src/model/CreateAliasRequest.cc +++ b/kms/src/model/CreateAliasRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::CreateAliasRequest; CreateAliasRequest::CreateAliasRequest() : RpcServiceRequest("kms", "2016-01-20", "CreateAlias") -{} +{ + setMethod(HttpRequest::Method::Post); +} CreateAliasRequest::~CreateAliasRequest() {} diff --git a/kms/src/model/CreateKeyRequest.cc b/kms/src/model/CreateKeyRequest.cc index 37983af2f..72f278920 100644 --- a/kms/src/model/CreateKeyRequest.cc +++ b/kms/src/model/CreateKeyRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::CreateKeyRequest; CreateKeyRequest::CreateKeyRequest() : RpcServiceRequest("kms", "2016-01-20", "CreateKey") -{} +{ + setMethod(HttpRequest::Method::Post); +} CreateKeyRequest::~CreateKeyRequest() {} @@ -69,6 +71,17 @@ void CreateKeyRequest::setDescription(const std::string& description) setCoreParameter("Description", description); } +std::string CreateKeyRequest::getKeySpec()const +{ + return keySpec_; +} + +void CreateKeyRequest::setKeySpec(const std::string& keySpec) +{ + keySpec_ = keySpec; + setCoreParameter("KeySpec", keySpec); +} + std::string CreateKeyRequest::getRotationInterval()const { return rotationInterval_; diff --git a/kms/src/model/CreateKeyResult.cc b/kms/src/model/CreateKeyResult.cc index c95d6e65a..946d5f94b 100644 --- a/kms/src/model/CreateKeyResult.cc +++ b/kms/src/model/CreateKeyResult.cc @@ -72,6 +72,8 @@ void CreateKeyResult::parse(const std::string &payload) keyMetadata_.rotationInterval = keyMetadataNode["RotationInterval"].asString(); if(!keyMetadataNode["NextRotationDate"].isNull()) keyMetadata_.nextRotationDate = keyMetadataNode["NextRotationDate"].asString(); + if(!keyMetadataNode["KeySpec"].isNull()) + keyMetadata_.keySpec = keyMetadataNode["KeySpec"].asString(); } diff --git a/kms/src/model/CreateKeyVersionRequest.cc b/kms/src/model/CreateKeyVersionRequest.cc new file mode 100644 index 000000000..671b20673 --- /dev/null +++ b/kms/src/model/CreateKeyVersionRequest.cc @@ -0,0 +1,40 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Kms::Model::CreateKeyVersionRequest; + +CreateKeyVersionRequest::CreateKeyVersionRequest() : + RpcServiceRequest("kms", "2016-01-20", "CreateKeyVersion") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateKeyVersionRequest::~CreateKeyVersionRequest() +{} + +std::string CreateKeyVersionRequest::getKeyId()const +{ + return keyId_; +} + +void CreateKeyVersionRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + diff --git a/kms/src/model/CreateKeyVersionResult.cc b/kms/src/model/CreateKeyVersionResult.cc new file mode 100644 index 000000000..e305e5873 --- /dev/null +++ b/kms/src/model/CreateKeyVersionResult.cc @@ -0,0 +1,56 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Kms; +using namespace AlibabaCloud::Kms::Model; + +CreateKeyVersionResult::CreateKeyVersionResult() : + ServiceResult() +{} + +CreateKeyVersionResult::CreateKeyVersionResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateKeyVersionResult::~CreateKeyVersionResult() +{} + +void CreateKeyVersionResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto keyVersionNode = value["KeyVersion"]; + if(!keyVersionNode["KeyId"].isNull()) + keyVersion_.keyId = keyVersionNode["KeyId"].asString(); + if(!keyVersionNode["KeyVersionId"].isNull()) + keyVersion_.keyVersionId = keyVersionNode["KeyVersionId"].asString(); + if(!keyVersionNode["CreationDate"].isNull()) + keyVersion_.creationDate = keyVersionNode["CreationDate"].asString(); + +} + +CreateKeyVersionResult::KeyVersion CreateKeyVersionResult::getKeyVersion()const +{ + return keyVersion_; +} + diff --git a/kms/src/model/DecryptRequest.cc b/kms/src/model/DecryptRequest.cc index e9d88fbb5..2817ba614 100644 --- a/kms/src/model/DecryptRequest.cc +++ b/kms/src/model/DecryptRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DecryptRequest; DecryptRequest::DecryptRequest() : RpcServiceRequest("kms", "2016-01-20", "Decrypt") -{} +{ + setMethod(HttpRequest::Method::Post); +} DecryptRequest::~DecryptRequest() {} diff --git a/kms/src/model/DeleteAliasRequest.cc b/kms/src/model/DeleteAliasRequest.cc index bb68580a2..0a1949acf 100644 --- a/kms/src/model/DeleteAliasRequest.cc +++ b/kms/src/model/DeleteAliasRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DeleteAliasRequest; DeleteAliasRequest::DeleteAliasRequest() : RpcServiceRequest("kms", "2016-01-20", "DeleteAlias") -{} +{ + setMethod(HttpRequest::Method::Post); +} DeleteAliasRequest::~DeleteAliasRequest() {} diff --git a/kms/src/model/DeleteKeyMaterialRequest.cc b/kms/src/model/DeleteKeyMaterialRequest.cc index 54216c4e9..281ed9a55 100644 --- a/kms/src/model/DeleteKeyMaterialRequest.cc +++ b/kms/src/model/DeleteKeyMaterialRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DeleteKeyMaterialRequest; DeleteKeyMaterialRequest::DeleteKeyMaterialRequest() : RpcServiceRequest("kms", "2016-01-20", "DeleteKeyMaterial") -{} +{ + setMethod(HttpRequest::Method::Post); +} DeleteKeyMaterialRequest::~DeleteKeyMaterialRequest() {} diff --git a/kms/src/model/DescribeKeyRequest.cc b/kms/src/model/DescribeKeyRequest.cc index 424fbeef7..82e8e54f2 100644 --- a/kms/src/model/DescribeKeyRequest.cc +++ b/kms/src/model/DescribeKeyRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DescribeKeyRequest; DescribeKeyRequest::DescribeKeyRequest() : RpcServiceRequest("kms", "2016-01-20", "DescribeKey") -{} +{ + setMethod(HttpRequest::Method::Post); +} DescribeKeyRequest::~DescribeKeyRequest() {} diff --git a/kms/src/model/DescribeKeyResult.cc b/kms/src/model/DescribeKeyResult.cc index b4f5bfbb6..919fce610 100644 --- a/kms/src/model/DescribeKeyResult.cc +++ b/kms/src/model/DescribeKeyResult.cc @@ -72,6 +72,8 @@ void DescribeKeyResult::parse(const std::string &payload) keyMetadata_.rotationInterval = keyMetadataNode["RotationInterval"].asString(); if(!keyMetadataNode["NextRotationDate"].isNull()) keyMetadata_.nextRotationDate = keyMetadataNode["NextRotationDate"].asString(); + if(!keyMetadataNode["KeySpec"].isNull()) + keyMetadata_.keySpec = keyMetadataNode["KeySpec"].asString(); } diff --git a/kms/src/model/DescribeKeyVersionRequest.cc b/kms/src/model/DescribeKeyVersionRequest.cc index 9ca21ef65..829814e9d 100644 --- a/kms/src/model/DescribeKeyVersionRequest.cc +++ b/kms/src/model/DescribeKeyVersionRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DescribeKeyVersionRequest; DescribeKeyVersionRequest::DescribeKeyVersionRequest() : RpcServiceRequest("kms", "2016-01-20", "DescribeKeyVersion") -{} +{ + setMethod(HttpRequest::Method::Post); +} DescribeKeyVersionRequest::~DescribeKeyVersionRequest() {} diff --git a/kms/src/model/DescribeRegionsRequest.cc b/kms/src/model/DescribeRegionsRequest.cc index 8b783eaf8..8deaad873 100644 --- a/kms/src/model/DescribeRegionsRequest.cc +++ b/kms/src/model/DescribeRegionsRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DescribeRegionsRequest; DescribeRegionsRequest::DescribeRegionsRequest() : RpcServiceRequest("kms", "2016-01-20", "DescribeRegions") -{} +{ + setMethod(HttpRequest::Method::Post); +} DescribeRegionsRequest::~DescribeRegionsRequest() {} diff --git a/kms/src/model/DescribeServiceRequest.cc b/kms/src/model/DescribeServiceRequest.cc index 3d4e39423..b10dbdc1e 100644 --- a/kms/src/model/DescribeServiceRequest.cc +++ b/kms/src/model/DescribeServiceRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DescribeServiceRequest; DescribeServiceRequest::DescribeServiceRequest() : RpcServiceRequest("kms", "2016-01-20", "DescribeService") -{} +{ + setMethod(HttpRequest::Method::Post); +} DescribeServiceRequest::~DescribeServiceRequest() {} diff --git a/kms/src/model/DisableKeyRequest.cc b/kms/src/model/DisableKeyRequest.cc index 1506a75ff..948df1e06 100644 --- a/kms/src/model/DisableKeyRequest.cc +++ b/kms/src/model/DisableKeyRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DisableKeyRequest; DisableKeyRequest::DisableKeyRequest() : RpcServiceRequest("kms", "2016-01-20", "DisableKey") -{} +{ + setMethod(HttpRequest::Method::Post); +} DisableKeyRequest::~DisableKeyRequest() {} diff --git a/kms/src/model/EnableKeyRequest.cc b/kms/src/model/EnableKeyRequest.cc index 1bae55736..54a745050 100644 --- a/kms/src/model/EnableKeyRequest.cc +++ b/kms/src/model/EnableKeyRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::EnableKeyRequest; EnableKeyRequest::EnableKeyRequest() : RpcServiceRequest("kms", "2016-01-20", "EnableKey") -{} +{ + setMethod(HttpRequest::Method::Post); +} EnableKeyRequest::~EnableKeyRequest() {} diff --git a/kms/src/model/EncryptRequest.cc b/kms/src/model/EncryptRequest.cc index ae248e078..b940e193a 100644 --- a/kms/src/model/EncryptRequest.cc +++ b/kms/src/model/EncryptRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::EncryptRequest; EncryptRequest::EncryptRequest() : RpcServiceRequest("kms", "2016-01-20", "Encrypt") -{} +{ + setMethod(HttpRequest::Method::Post); +} EncryptRequest::~EncryptRequest() {} diff --git a/kms/src/model/GenerateDataKeyRequest.cc b/kms/src/model/GenerateDataKeyRequest.cc index f50134792..d03dfe85c 100644 --- a/kms/src/model/GenerateDataKeyRequest.cc +++ b/kms/src/model/GenerateDataKeyRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::GenerateDataKeyRequest; GenerateDataKeyRequest::GenerateDataKeyRequest() : RpcServiceRequest("kms", "2016-01-20", "GenerateDataKey") -{} +{ + setMethod(HttpRequest::Method::Post); +} GenerateDataKeyRequest::~GenerateDataKeyRequest() {} diff --git a/kms/src/model/GenerateDataKeyWithoutPlaintextRequest.cc b/kms/src/model/GenerateDataKeyWithoutPlaintextRequest.cc index 15f267610..24bef8d18 100644 --- a/kms/src/model/GenerateDataKeyWithoutPlaintextRequest.cc +++ b/kms/src/model/GenerateDataKeyWithoutPlaintextRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::GenerateDataKeyWithoutPlaintextRequest; GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest() : RpcServiceRequest("kms", "2016-01-20", "GenerateDataKeyWithoutPlaintext") -{} +{ + setMethod(HttpRequest::Method::Post); +} GenerateDataKeyWithoutPlaintextRequest::~GenerateDataKeyWithoutPlaintextRequest() {} diff --git a/kms/src/model/GetParametersForImportRequest.cc b/kms/src/model/GetParametersForImportRequest.cc index 2b6a30b42..7d96c0f44 100644 --- a/kms/src/model/GetParametersForImportRequest.cc +++ b/kms/src/model/GetParametersForImportRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::GetParametersForImportRequest; GetParametersForImportRequest::GetParametersForImportRequest() : RpcServiceRequest("kms", "2016-01-20", "GetParametersForImport") -{} +{ + setMethod(HttpRequest::Method::Post); +} GetParametersForImportRequest::~GetParametersForImportRequest() {} diff --git a/kms/src/model/GetPublicKeyRequest.cc b/kms/src/model/GetPublicKeyRequest.cc new file mode 100644 index 000000000..c4bcbbe4b --- /dev/null +++ b/kms/src/model/GetPublicKeyRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Kms::Model::GetPublicKeyRequest; + +GetPublicKeyRequest::GetPublicKeyRequest() : + RpcServiceRequest("kms", "2016-01-20", "GetPublicKey") +{ + setMethod(HttpRequest::Method::Post); +} + +GetPublicKeyRequest::~GetPublicKeyRequest() +{} + +std::string GetPublicKeyRequest::getKeyVersionId()const +{ + return keyVersionId_; +} + +void GetPublicKeyRequest::setKeyVersionId(const std::string& keyVersionId) +{ + keyVersionId_ = keyVersionId; + setCoreParameter("KeyVersionId", keyVersionId); +} + +std::string GetPublicKeyRequest::getKeyId()const +{ + return keyId_; +} + +void GetPublicKeyRequest::setKeyId(const std::string& keyId) +{ + keyId_ = keyId; + setCoreParameter("KeyId", keyId); +} + diff --git a/kms/src/model/GetPublicKeyResult.cc b/kms/src/model/GetPublicKeyResult.cc new file mode 100644 index 000000000..8fb5be1f6 --- /dev/null +++ b/kms/src/model/GetPublicKeyResult.cc @@ -0,0 +1,65 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Kms; +using namespace AlibabaCloud::Kms::Model; + +GetPublicKeyResult::GetPublicKeyResult() : + ServiceResult() +{} + +GetPublicKeyResult::GetPublicKeyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetPublicKeyResult::~GetPublicKeyResult() +{} + +void GetPublicKeyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["PublicKey"].isNull()) + publicKey_ = value["PublicKey"].asString(); + if(!value["KeyId"].isNull()) + keyId_ = value["KeyId"].asString(); + if(!value["KeyVersionId"].isNull()) + keyVersionId_ = value["KeyVersionId"].asString(); + +} + +std::string GetPublicKeyResult::getPublicKey()const +{ + return publicKey_; +} + +std::string GetPublicKeyResult::getKeyId()const +{ + return keyId_; +} + +std::string GetPublicKeyResult::getKeyVersionId()const +{ + return keyVersionId_; +} + diff --git a/kms/src/model/ImportKeyMaterialRequest.cc b/kms/src/model/ImportKeyMaterialRequest.cc index 3e9cf81e6..fc04c5e84 100644 --- a/kms/src/model/ImportKeyMaterialRequest.cc +++ b/kms/src/model/ImportKeyMaterialRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ImportKeyMaterialRequest; ImportKeyMaterialRequest::ImportKeyMaterialRequest() : RpcServiceRequest("kms", "2016-01-20", "ImportKeyMaterial") -{} +{ + setMethod(HttpRequest::Method::Post); +} ImportKeyMaterialRequest::~ImportKeyMaterialRequest() {} diff --git a/kms/src/model/ListAliasesByKeyIdRequest.cc b/kms/src/model/ListAliasesByKeyIdRequest.cc index ef1f71c9b..42d24138b 100644 --- a/kms/src/model/ListAliasesByKeyIdRequest.cc +++ b/kms/src/model/ListAliasesByKeyIdRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListAliasesByKeyIdRequest; ListAliasesByKeyIdRequest::ListAliasesByKeyIdRequest() : RpcServiceRequest("kms", "2016-01-20", "ListAliasesByKeyId") -{} +{ + setMethod(HttpRequest::Method::Post); +} ListAliasesByKeyIdRequest::~ListAliasesByKeyIdRequest() {} diff --git a/kms/src/model/ListAliasesRequest.cc b/kms/src/model/ListAliasesRequest.cc index d730a92c4..e341af8b5 100644 --- a/kms/src/model/ListAliasesRequest.cc +++ b/kms/src/model/ListAliasesRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListAliasesRequest; ListAliasesRequest::ListAliasesRequest() : RpcServiceRequest("kms", "2016-01-20", "ListAliases") -{} +{ + setMethod(HttpRequest::Method::Post); +} ListAliasesRequest::~ListAliasesRequest() {} diff --git a/kms/src/model/ListKeyVersionsRequest.cc b/kms/src/model/ListKeyVersionsRequest.cc index fffff9041..b25283ef1 100644 --- a/kms/src/model/ListKeyVersionsRequest.cc +++ b/kms/src/model/ListKeyVersionsRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListKeyVersionsRequest; ListKeyVersionsRequest::ListKeyVersionsRequest() : RpcServiceRequest("kms", "2016-01-20", "ListKeyVersions") -{} +{ + setMethod(HttpRequest::Method::Post); +} ListKeyVersionsRequest::~ListKeyVersionsRequest() {} diff --git a/kms/src/model/ListKeysRequest.cc b/kms/src/model/ListKeysRequest.cc index ff99c7a9c..76097946a 100644 --- a/kms/src/model/ListKeysRequest.cc +++ b/kms/src/model/ListKeysRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListKeysRequest; ListKeysRequest::ListKeysRequest() : RpcServiceRequest("kms", "2016-01-20", "ListKeys") -{} +{ + setMethod(HttpRequest::Method::Post); +} ListKeysRequest::~ListKeysRequest() {} diff --git a/kms/src/model/ListResourceTagsRequest.cc b/kms/src/model/ListResourceTagsRequest.cc index 1b3126513..64b62392b 100644 --- a/kms/src/model/ListResourceTagsRequest.cc +++ b/kms/src/model/ListResourceTagsRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListResourceTagsRequest; ListResourceTagsRequest::ListResourceTagsRequest() : RpcServiceRequest("kms", "2016-01-20", "ListResourceTags") -{} +{ + setMethod(HttpRequest::Method::Post); +} ListResourceTagsRequest::~ListResourceTagsRequest() {} diff --git a/kms/src/model/ScheduleKeyDeletionRequest.cc b/kms/src/model/ScheduleKeyDeletionRequest.cc index f2e5a886e..cec2ee6f3 100644 --- a/kms/src/model/ScheduleKeyDeletionRequest.cc +++ b/kms/src/model/ScheduleKeyDeletionRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ScheduleKeyDeletionRequest; ScheduleKeyDeletionRequest::ScheduleKeyDeletionRequest() : RpcServiceRequest("kms", "2016-01-20", "ScheduleKeyDeletion") -{} +{ + setMethod(HttpRequest::Method::Post); +} ScheduleKeyDeletionRequest::~ScheduleKeyDeletionRequest() {} diff --git a/kms/src/model/TagResourceRequest.cc b/kms/src/model/TagResourceRequest.cc index 04499cfeb..0c51fd011 100644 --- a/kms/src/model/TagResourceRequest.cc +++ b/kms/src/model/TagResourceRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::TagResourceRequest; TagResourceRequest::TagResourceRequest() : RpcServiceRequest("kms", "2016-01-20", "TagResource") -{} +{ + setMethod(HttpRequest::Method::Post); +} TagResourceRequest::~TagResourceRequest() {} diff --git a/kms/src/model/UntagResourceRequest.cc b/kms/src/model/UntagResourceRequest.cc index deb349f1c..83b6d0f91 100644 --- a/kms/src/model/UntagResourceRequest.cc +++ b/kms/src/model/UntagResourceRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::UntagResourceRequest; UntagResourceRequest::UntagResourceRequest() : RpcServiceRequest("kms", "2016-01-20", "UntagResource") -{} +{ + setMethod(HttpRequest::Method::Post); +} UntagResourceRequest::~UntagResourceRequest() {} diff --git a/kms/src/model/UpdateAliasRequest.cc b/kms/src/model/UpdateAliasRequest.cc index 53178e10f..302c7bfe6 100644 --- a/kms/src/model/UpdateAliasRequest.cc +++ b/kms/src/model/UpdateAliasRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::UpdateAliasRequest; UpdateAliasRequest::UpdateAliasRequest() : RpcServiceRequest("kms", "2016-01-20", "UpdateAlias") -{} +{ + setMethod(HttpRequest::Method::Post); +} UpdateAliasRequest::~UpdateAliasRequest() {} diff --git a/kms/src/model/UpdateKeyDescriptionRequest.cc b/kms/src/model/UpdateKeyDescriptionRequest.cc index 9cda16f84..60ba5e010 100644 --- a/kms/src/model/UpdateKeyDescriptionRequest.cc +++ b/kms/src/model/UpdateKeyDescriptionRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::UpdateKeyDescriptionRequest; UpdateKeyDescriptionRequest::UpdateKeyDescriptionRequest() : RpcServiceRequest("kms", "2016-01-20", "UpdateKeyDescription") -{} +{ + setMethod(HttpRequest::Method::Post); +} UpdateKeyDescriptionRequest::~UpdateKeyDescriptionRequest() {} diff --git a/kms/src/model/UpdateRotationPolicyRequest.cc b/kms/src/model/UpdateRotationPolicyRequest.cc index 3f50cc4d0..e8e4e9c86 100644 --- a/kms/src/model/UpdateRotationPolicyRequest.cc +++ b/kms/src/model/UpdateRotationPolicyRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::UpdateRotationPolicyRequest; UpdateRotationPolicyRequest::UpdateRotationPolicyRequest() : RpcServiceRequest("kms", "2016-01-20", "UpdateRotationPolicy") -{} +{ + setMethod(HttpRequest::Method::Post); +} UpdateRotationPolicyRequest::~UpdateRotationPolicyRequest() {}