Add GenerateAndExportDataKey, ExportDataKey, ReEncrypt api.

This commit is contained in:
sdk-team
2020-07-23 09:28:08 +08:00
parent e57fc8314f
commit 84d7d5b467
17 changed files with 1008 additions and 4 deletions

View File

@@ -64,6 +64,10 @@
#include "model/EnableKeyResult.h"
#include "model/EncryptRequest.h"
#include "model/EncryptResult.h"
#include "model/ExportDataKeyRequest.h"
#include "model/ExportDataKeyResult.h"
#include "model/GenerateAndExportDataKeyRequest.h"
#include "model/GenerateAndExportDataKeyResult.h"
#include "model/GenerateDataKeyRequest.h"
#include "model/GenerateDataKeyResult.h"
#include "model/GenerateDataKeyWithoutPlaintextRequest.h"
@@ -94,6 +98,8 @@
#include "model/ListSecretsResult.h"
#include "model/PutSecretValueRequest.h"
#include "model/PutSecretValueResult.h"
#include "model/ReEncryptRequest.h"
#include "model/ReEncryptResult.h"
#include "model/RestoreSecretRequest.h"
#include "model/RestoreSecretResult.h"
#include "model/ScheduleKeyDeletionRequest.h"
@@ -184,6 +190,12 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::EncryptResult> EncryptOutcome;
typedef std::future<EncryptOutcome> EncryptOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::EncryptRequest&, const EncryptOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> EncryptAsyncHandler;
typedef Outcome<Error, Model::ExportDataKeyResult> ExportDataKeyOutcome;
typedef std::future<ExportDataKeyOutcome> ExportDataKeyOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::ExportDataKeyRequest&, const ExportDataKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ExportDataKeyAsyncHandler;
typedef Outcome<Error, Model::GenerateAndExportDataKeyResult> GenerateAndExportDataKeyOutcome;
typedef std::future<GenerateAndExportDataKeyOutcome> GenerateAndExportDataKeyOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::GenerateAndExportDataKeyRequest&, const GenerateAndExportDataKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateAndExportDataKeyAsyncHandler;
typedef Outcome<Error, Model::GenerateDataKeyResult> GenerateDataKeyOutcome;
typedef std::future<GenerateDataKeyOutcome> GenerateDataKeyOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::GenerateDataKeyRequest&, const GenerateDataKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateDataKeyAsyncHandler;
@@ -229,6 +241,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::PutSecretValueResult> PutSecretValueOutcome;
typedef std::future<PutSecretValueOutcome> PutSecretValueOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::PutSecretValueRequest&, const PutSecretValueOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PutSecretValueAsyncHandler;
typedef Outcome<Error, Model::ReEncryptResult> ReEncryptOutcome;
typedef std::future<ReEncryptOutcome> ReEncryptOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::ReEncryptRequest&, const ReEncryptOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReEncryptAsyncHandler;
typedef Outcome<Error, Model::RestoreSecretResult> RestoreSecretOutcome;
typedef std::future<RestoreSecretOutcome> RestoreSecretOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::RestoreSecretRequest&, const RestoreSecretOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RestoreSecretAsyncHandler;
@@ -324,6 +339,12 @@ namespace AlibabaCloud
EncryptOutcome encrypt(const Model::EncryptRequest &request)const;
void encryptAsync(const Model::EncryptRequest& request, const EncryptAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
EncryptOutcomeCallable encryptCallable(const Model::EncryptRequest& request) const;
ExportDataKeyOutcome exportDataKey(const Model::ExportDataKeyRequest &request)const;
void exportDataKeyAsync(const Model::ExportDataKeyRequest& request, const ExportDataKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ExportDataKeyOutcomeCallable exportDataKeyCallable(const Model::ExportDataKeyRequest& request) const;
GenerateAndExportDataKeyOutcome generateAndExportDataKey(const Model::GenerateAndExportDataKeyRequest &request)const;
void generateAndExportDataKeyAsync(const Model::GenerateAndExportDataKeyRequest& request, const GenerateAndExportDataKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GenerateAndExportDataKeyOutcomeCallable generateAndExportDataKeyCallable(const Model::GenerateAndExportDataKeyRequest& request) const;
GenerateDataKeyOutcome generateDataKey(const Model::GenerateDataKeyRequest &request)const;
void generateDataKeyAsync(const Model::GenerateDataKeyRequest& request, const GenerateDataKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GenerateDataKeyOutcomeCallable generateDataKeyCallable(const Model::GenerateDataKeyRequest& request) const;
@@ -369,6 +390,9 @@ namespace AlibabaCloud
PutSecretValueOutcome putSecretValue(const Model::PutSecretValueRequest &request)const;
void putSecretValueAsync(const Model::PutSecretValueRequest& request, const PutSecretValueAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
PutSecretValueOutcomeCallable putSecretValueCallable(const Model::PutSecretValueRequest& request) const;
ReEncryptOutcome reEncrypt(const Model::ReEncryptRequest &request)const;
void reEncryptAsync(const Model::ReEncryptRequest& request, const ReEncryptAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ReEncryptOutcomeCallable reEncryptCallable(const Model::ReEncryptRequest& request) const;
RestoreSecretOutcome restoreSecret(const Model::RestoreSecretRequest &request)const;
void restoreSecretAsync(const Model::RestoreSecretRequest& request, const RestoreSecretAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RestoreSecretOutcomeCallable restoreSecretCallable(const Model::RestoreSecretRequest& request) const;

View File

@@ -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_EXPORTDATAKEYREQUEST_H_
#define ALIBABACLOUD_KMS_MODEL_EXPORTDATAKEYREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT ExportDataKeyRequest : public RpcServiceRequest
{
public:
ExportDataKeyRequest();
~ExportDataKeyRequest();
std::string getEncryptionContext()const;
void setEncryptionContext(const std::string& encryptionContext);
std::string getWrappingAlgorithm()const;
void setWrappingAlgorithm(const std::string& wrappingAlgorithm);
std::string getCiphertextBlob()const;
void setCiphertextBlob(const std::string& ciphertextBlob);
std::string getPublicKeyBlob()const;
void setPublicKeyBlob(const std::string& publicKeyBlob);
std::string getWrappingKeySpec()const;
void setWrappingKeySpec(const std::string& wrappingKeySpec);
private:
std::string encryptionContext_;
std::string wrappingAlgorithm_;
std::string ciphertextBlob_;
std::string publicKeyBlob_;
std::string wrappingKeySpec_;
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_EXPORTDATAKEYREQUEST_H_

View File

@@ -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_EXPORTDATAKEYRESULT_H_
#define ALIBABACLOUD_KMS_MODEL_EXPORTDATAKEYRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT ExportDataKeyResult : public ServiceResult
{
public:
ExportDataKeyResult();
explicit ExportDataKeyResult(const std::string &payload);
~ExportDataKeyResult();
std::string getExportedDataKey()const;
std::string getKeyId()const;
std::string getKeyVersionId()const;
protected:
void parse(const std::string &payload);
private:
std::string exportedDataKey_;
std::string keyId_;
std::string keyVersionId_;
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_EXPORTDATAKEYRESULT_H_

View File

@@ -0,0 +1,66 @@
/*
* 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_GENERATEANDEXPORTDATAKEYREQUEST_H_
#define ALIBABACLOUD_KMS_MODEL_GENERATEANDEXPORTDATAKEYREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT GenerateAndExportDataKeyRequest : public RpcServiceRequest
{
public:
GenerateAndExportDataKeyRequest();
~GenerateAndExportDataKeyRequest();
std::string getEncryptionContext()const;
void setEncryptionContext(const std::string& encryptionContext);
std::string getKeyId()const;
void setKeyId(const std::string& keyId);
std::string getKeySpec()const;
void setKeySpec(const std::string& keySpec);
int getNumberOfBytes()const;
void setNumberOfBytes(int numberOfBytes);
std::string getWrappingAlgorithm()const;
void setWrappingAlgorithm(const std::string& wrappingAlgorithm);
std::string getPublicKeyBlob()const;
void setPublicKeyBlob(const std::string& publicKeyBlob);
std::string getWrappingKeySpec()const;
void setWrappingKeySpec(const std::string& wrappingKeySpec);
private:
std::string encryptionContext_;
std::string keyId_;
std::string keySpec_;
int numberOfBytes_;
std::string wrappingAlgorithm_;
std::string publicKeyBlob_;
std::string wrappingKeySpec_;
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_GENERATEANDEXPORTDATAKEYREQUEST_H_

View File

@@ -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_GENERATEANDEXPORTDATAKEYRESULT_H_
#define ALIBABACLOUD_KMS_MODEL_GENERATEANDEXPORTDATAKEYRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT GenerateAndExportDataKeyResult : public ServiceResult
{
public:
GenerateAndExportDataKeyResult();
explicit GenerateAndExportDataKeyResult(const std::string &payload);
~GenerateAndExportDataKeyResult();
std::string getCiphertextBlob()const;
std::string getExportedDataKey()const;
std::string getKeyId()const;
std::string getKeyVersionId()const;
protected:
void parse(const std::string &payload);
private:
std::string ciphertextBlob_;
std::string exportedDataKey_;
std::string keyId_;
std::string keyVersionId_;
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_GENERATEANDEXPORTDATAKEYRESULT_H_

View File

@@ -0,0 +1,66 @@
/*
* 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_REENCRYPTREQUEST_H_
#define ALIBABACLOUD_KMS_MODEL_REENCRYPTREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT ReEncryptRequest : public RpcServiceRequest
{
public:
ReEncryptRequest();
~ReEncryptRequest();
std::string getDestinationEncryptionContext()const;
void setDestinationEncryptionContext(const std::string& destinationEncryptionContext);
std::string getSourceEncryptionAlgorithm()const;
void setSourceEncryptionAlgorithm(const std::string& sourceEncryptionAlgorithm);
std::string getSourceKeyVersionId()const;
void setSourceKeyVersionId(const std::string& sourceKeyVersionId);
std::string getDestinationKeyId()const;
void setDestinationKeyId(const std::string& destinationKeyId);
std::string getSourceKeyId()const;
void setSourceKeyId(const std::string& sourceKeyId);
std::string getSourceEncryptionContext()const;
void setSourceEncryptionContext(const std::string& sourceEncryptionContext);
std::string getCiphertextBlob()const;
void setCiphertextBlob(const std::string& ciphertextBlob);
private:
std::string destinationEncryptionContext_;
std::string sourceEncryptionAlgorithm_;
std::string sourceKeyVersionId_;
std::string destinationKeyId_;
std::string sourceKeyId_;
std::string sourceEncryptionContext_;
std::string ciphertextBlob_;
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_REENCRYPTREQUEST_H_

View File

@@ -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_REENCRYPTRESULT_H_
#define ALIBABACLOUD_KMS_MODEL_REENCRYPTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT ReEncryptResult : public ServiceResult
{
public:
ReEncryptResult();
explicit ReEncryptResult(const std::string &payload);
~ReEncryptResult();
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_REENCRYPTRESULT_H_