Support asymmetric keys.
This commit is contained in:
@@ -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<const AsyncCallerContext>& 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<std::packaged_task<AsymmetricDecryptOutcome()>>(
|
||||
[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<const AsyncCallerContext>& 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<std::packaged_task<AsymmetricEncryptOutcome()>>(
|
||||
[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<const AsyncCallerContext>& 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<std::packaged_task<AsymmetricSignOutcome()>>(
|
||||
[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<const AsyncCallerContext>& 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<std::packaged_task<AsymmetricVerifyOutcome()>>(
|
||||
[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<const AsyncCallerContext>& 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<std::packaged_task<CreateKeyVersionOutcome()>>(
|
||||
[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<const AsyncCallerContext>& 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<std::packaged_task<GetPublicKeyOutcome()>>(
|
||||
[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();
|
||||
|
||||
73
kms/src/model/AsymmetricDecryptRequest.cc
Normal file
73
kms/src/model/AsymmetricDecryptRequest.cc
Normal file
@@ -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 <alibabacloud/kms/model/AsymmetricDecryptRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
65
kms/src/model/AsymmetricDecryptResult.cc
Normal file
65
kms/src/model/AsymmetricDecryptResult.cc
Normal file
@@ -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 <alibabacloud/kms/model/AsymmetricDecryptResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
73
kms/src/model/AsymmetricEncryptRequest.cc
Normal file
73
kms/src/model/AsymmetricEncryptRequest.cc
Normal file
@@ -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 <alibabacloud/kms/model/AsymmetricEncryptRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
65
kms/src/model/AsymmetricEncryptResult.cc
Normal file
65
kms/src/model/AsymmetricEncryptResult.cc
Normal file
@@ -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 <alibabacloud/kms/model/AsymmetricEncryptResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
73
kms/src/model/AsymmetricSignRequest.cc
Normal file
73
kms/src/model/AsymmetricSignRequest.cc
Normal file
@@ -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 <alibabacloud/kms/model/AsymmetricSignRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
65
kms/src/model/AsymmetricSignResult.cc
Normal file
65
kms/src/model/AsymmetricSignResult.cc
Normal file
@@ -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 <alibabacloud/kms/model/AsymmetricSignResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
84
kms/src/model/AsymmetricVerifyRequest.cc
Normal file
84
kms/src/model/AsymmetricVerifyRequest.cc
Normal file
@@ -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 <alibabacloud/kms/model/AsymmetricVerifyRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
65
kms/src/model/AsymmetricVerifyResult.cc
Normal file
65
kms/src/model/AsymmetricVerifyResult.cc
Normal file
@@ -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 <alibabacloud/kms/model/AsymmetricVerifyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::CancelKeyDeletionRequest;
|
||||
|
||||
CancelKeyDeletionRequest::CancelKeyDeletionRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "CancelKeyDeletion")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CancelKeyDeletionRequest::~CancelKeyDeletionRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::CreateAliasRequest;
|
||||
|
||||
CreateAliasRequest::CreateAliasRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "CreateAlias")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateAliasRequest::~CreateAliasRequest()
|
||||
{}
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
40
kms/src/model/CreateKeyVersionRequest.cc
Normal file
40
kms/src/model/CreateKeyVersionRequest.cc
Normal file
@@ -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 <alibabacloud/kms/model/CreateKeyVersionRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
56
kms/src/model/CreateKeyVersionResult.cc
Normal file
56
kms/src/model/CreateKeyVersionResult.cc
Normal file
@@ -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 <alibabacloud/kms/model/CreateKeyVersionResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DecryptRequest;
|
||||
|
||||
DecryptRequest::DecryptRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "Decrypt")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DecryptRequest::~DecryptRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DeleteAliasRequest;
|
||||
|
||||
DeleteAliasRequest::DeleteAliasRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "DeleteAlias")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteAliasRequest::~DeleteAliasRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DeleteKeyMaterialRequest;
|
||||
|
||||
DeleteKeyMaterialRequest::DeleteKeyMaterialRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "DeleteKeyMaterial")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteKeyMaterialRequest::~DeleteKeyMaterialRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DescribeKeyRequest;
|
||||
|
||||
DescribeKeyRequest::DescribeKeyRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "DescribeKey")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribeKeyRequest::~DescribeKeyRequest()
|
||||
{}
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DescribeKeyVersionRequest;
|
||||
|
||||
DescribeKeyVersionRequest::DescribeKeyVersionRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "DescribeKeyVersion")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribeKeyVersionRequest::~DescribeKeyVersionRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DescribeRegionsRequest;
|
||||
|
||||
DescribeRegionsRequest::DescribeRegionsRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "DescribeRegions")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribeRegionsRequest::~DescribeRegionsRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DescribeServiceRequest;
|
||||
|
||||
DescribeServiceRequest::DescribeServiceRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "DescribeService")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribeServiceRequest::~DescribeServiceRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::DisableKeyRequest;
|
||||
|
||||
DisableKeyRequest::DisableKeyRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "DisableKey")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DisableKeyRequest::~DisableKeyRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::EnableKeyRequest;
|
||||
|
||||
EnableKeyRequest::EnableKeyRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "EnableKey")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
EnableKeyRequest::~EnableKeyRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::EncryptRequest;
|
||||
|
||||
EncryptRequest::EncryptRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "Encrypt")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
EncryptRequest::~EncryptRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::GenerateDataKeyRequest;
|
||||
|
||||
GenerateDataKeyRequest::GenerateDataKeyRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "GenerateDataKey")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GenerateDataKeyRequest::~GenerateDataKeyRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::GenerateDataKeyWithoutPlaintextRequest;
|
||||
|
||||
GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "GenerateDataKeyWithoutPlaintext")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GenerateDataKeyWithoutPlaintextRequest::~GenerateDataKeyWithoutPlaintextRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::GetParametersForImportRequest;
|
||||
|
||||
GetParametersForImportRequest::GetParametersForImportRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "GetParametersForImport")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetParametersForImportRequest::~GetParametersForImportRequest()
|
||||
{}
|
||||
|
||||
51
kms/src/model/GetPublicKeyRequest.cc
Normal file
51
kms/src/model/GetPublicKeyRequest.cc
Normal file
@@ -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 <alibabacloud/kms/model/GetPublicKeyRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
65
kms/src/model/GetPublicKeyResult.cc
Normal file
65
kms/src/model/GetPublicKeyResult.cc
Normal file
@@ -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 <alibabacloud/kms/model/GetPublicKeyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ImportKeyMaterialRequest;
|
||||
|
||||
ImportKeyMaterialRequest::ImportKeyMaterialRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "ImportKeyMaterial")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ImportKeyMaterialRequest::~ImportKeyMaterialRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListAliasesByKeyIdRequest;
|
||||
|
||||
ListAliasesByKeyIdRequest::ListAliasesByKeyIdRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "ListAliasesByKeyId")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListAliasesByKeyIdRequest::~ListAliasesByKeyIdRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListAliasesRequest;
|
||||
|
||||
ListAliasesRequest::ListAliasesRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "ListAliases")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListAliasesRequest::~ListAliasesRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListKeyVersionsRequest;
|
||||
|
||||
ListKeyVersionsRequest::ListKeyVersionsRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "ListKeyVersions")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListKeyVersionsRequest::~ListKeyVersionsRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListKeysRequest;
|
||||
|
||||
ListKeysRequest::ListKeysRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "ListKeys")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListKeysRequest::~ListKeysRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ListResourceTagsRequest;
|
||||
|
||||
ListResourceTagsRequest::ListResourceTagsRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "ListResourceTags")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListResourceTagsRequest::~ListResourceTagsRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::ScheduleKeyDeletionRequest;
|
||||
|
||||
ScheduleKeyDeletionRequest::ScheduleKeyDeletionRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "ScheduleKeyDeletion")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ScheduleKeyDeletionRequest::~ScheduleKeyDeletionRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::TagResourceRequest;
|
||||
|
||||
TagResourceRequest::TagResourceRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "TagResource")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
TagResourceRequest::~TagResourceRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::UntagResourceRequest;
|
||||
|
||||
UntagResourceRequest::UntagResourceRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "UntagResource")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UntagResourceRequest::~UntagResourceRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::UpdateAliasRequest;
|
||||
|
||||
UpdateAliasRequest::UpdateAliasRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "UpdateAlias")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdateAliasRequest::~UpdateAliasRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::UpdateKeyDescriptionRequest;
|
||||
|
||||
UpdateKeyDescriptionRequest::UpdateKeyDescriptionRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "UpdateKeyDescription")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdateKeyDescriptionRequest::~UpdateKeyDescriptionRequest()
|
||||
{}
|
||||
|
||||
@@ -20,7 +20,9 @@ using AlibabaCloud::Kms::Model::UpdateRotationPolicyRequest;
|
||||
|
||||
UpdateRotationPolicyRequest::UpdateRotationPolicyRequest() :
|
||||
RpcServiceRequest("kms", "2016-01-20", "UpdateRotationPolicy")
|
||||
{}
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdateRotationPolicyRequest::~UpdateRotationPolicyRequest()
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user