Skip to content

Commit 54c9ab3

Browse files
Add support for certificates to be signed by 3rd party certificate authorities. New API GetCertificateSigningRequest API and support for providing certificates at run-time for tr-34 import/export
1 parent d447a04 commit 54c9ab3

22 files changed

+1796
-826
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.11.646
1+
1.11.647

generated/src/aws-cpp-sdk-payment-cryptography/include/aws/payment-cryptography/PaymentCryptographyClient.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,31 @@ namespace PaymentCryptography
641641
return SubmitAsync(&PaymentCryptographyClient::GetAlias, request, handler, context);
642642
}
643643

644+
/**
645+
* <p>Used to retrieve the public key for a keypair.</p><p><h3>See Also:</h3> <a
646+
* href="http://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetCertificateSigningRequest">AWS
647+
* API Reference</a></p>
648+
*/
649+
virtual Model::GetCertificateSigningRequestOutcome GetCertificateSigningRequest(const Model::GetCertificateSigningRequestRequest& request) const;
650+
651+
/**
652+
* A Callable wrapper for GetCertificateSigningRequest that returns a future to the operation so that it can be executed in parallel to other requests.
653+
*/
654+
template<typename GetCertificateSigningRequestRequestT = Model::GetCertificateSigningRequestRequest>
655+
Model::GetCertificateSigningRequestOutcomeCallable GetCertificateSigningRequestCallable(const GetCertificateSigningRequestRequestT& request) const
656+
{
657+
return SubmitCallable(&PaymentCryptographyClient::GetCertificateSigningRequest, request);
658+
}
659+
660+
/**
661+
* An Async wrapper for GetCertificateSigningRequest that queues the request into a thread executor and triggers associated callback when operation has finished.
662+
*/
663+
template<typename GetCertificateSigningRequestRequestT = Model::GetCertificateSigningRequestRequest>
664+
void GetCertificateSigningRequestAsync(const GetCertificateSigningRequestRequestT& request, const GetCertificateSigningRequestResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const
665+
{
666+
return SubmitAsync(&PaymentCryptographyClient::GetCertificateSigningRequest, request, handler, context);
667+
}
668+
644669
/**
645670
* <p>Retrieves the list of regions where default key replication is currently
646671
* enabled for your account.</p> <p>This operation returns the current

generated/src/aws-cpp-sdk-payment-cryptography/include/aws/payment-cryptography/PaymentCryptographyServiceClientModel.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <aws/payment-cryptography/model/EnableDefaultKeyReplicationRegionsResult.h>
2828
#include <aws/payment-cryptography/model/ExportKeyResult.h>
2929
#include <aws/payment-cryptography/model/GetAliasResult.h>
30+
#include <aws/payment-cryptography/model/GetCertificateSigningRequestResult.h>
3031
#include <aws/payment-cryptography/model/GetDefaultKeyReplicationRegionsResult.h>
3132
#include <aws/payment-cryptography/model/GetKeyResult.h>
3233
#include <aws/payment-cryptography/model/GetParametersForExportResult.h>
@@ -95,6 +96,7 @@ namespace Aws
9596
class EnableDefaultKeyReplicationRegionsRequest;
9697
class ExportKeyRequest;
9798
class GetAliasRequest;
99+
class GetCertificateSigningRequestRequest;
98100
class GetDefaultKeyReplicationRegionsRequest;
99101
class GetKeyRequest;
100102
class GetParametersForExportRequest;
@@ -123,6 +125,7 @@ namespace Aws
123125
typedef Aws::Utils::Outcome<EnableDefaultKeyReplicationRegionsResult, PaymentCryptographyError> EnableDefaultKeyReplicationRegionsOutcome;
124126
typedef Aws::Utils::Outcome<ExportKeyResult, PaymentCryptographyError> ExportKeyOutcome;
125127
typedef Aws::Utils::Outcome<GetAliasResult, PaymentCryptographyError> GetAliasOutcome;
128+
typedef Aws::Utils::Outcome<GetCertificateSigningRequestResult, PaymentCryptographyError> GetCertificateSigningRequestOutcome;
126129
typedef Aws::Utils::Outcome<GetDefaultKeyReplicationRegionsResult, PaymentCryptographyError> GetDefaultKeyReplicationRegionsOutcome;
127130
typedef Aws::Utils::Outcome<GetKeyResult, PaymentCryptographyError> GetKeyOutcome;
128131
typedef Aws::Utils::Outcome<GetParametersForExportResult, PaymentCryptographyError> GetParametersForExportOutcome;
@@ -151,6 +154,7 @@ namespace Aws
151154
typedef std::future<EnableDefaultKeyReplicationRegionsOutcome> EnableDefaultKeyReplicationRegionsOutcomeCallable;
152155
typedef std::future<ExportKeyOutcome> ExportKeyOutcomeCallable;
153156
typedef std::future<GetAliasOutcome> GetAliasOutcomeCallable;
157+
typedef std::future<GetCertificateSigningRequestOutcome> GetCertificateSigningRequestOutcomeCallable;
154158
typedef std::future<GetDefaultKeyReplicationRegionsOutcome> GetDefaultKeyReplicationRegionsOutcomeCallable;
155159
typedef std::future<GetKeyOutcome> GetKeyOutcomeCallable;
156160
typedef std::future<GetParametersForExportOutcome> GetParametersForExportOutcomeCallable;
@@ -182,6 +186,7 @@ namespace Aws
182186
typedef std::function<void(const PaymentCryptographyClient*, const Model::EnableDefaultKeyReplicationRegionsRequest&, const Model::EnableDefaultKeyReplicationRegionsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > EnableDefaultKeyReplicationRegionsResponseReceivedHandler;
183187
typedef std::function<void(const PaymentCryptographyClient*, const Model::ExportKeyRequest&, const Model::ExportKeyOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ExportKeyResponseReceivedHandler;
184188
typedef std::function<void(const PaymentCryptographyClient*, const Model::GetAliasRequest&, const Model::GetAliasOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetAliasResponseReceivedHandler;
189+
typedef std::function<void(const PaymentCryptographyClient*, const Model::GetCertificateSigningRequestRequest&, const Model::GetCertificateSigningRequestOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetCertificateSigningRequestResponseReceivedHandler;
185190
typedef std::function<void(const PaymentCryptographyClient*, const Model::GetDefaultKeyReplicationRegionsRequest&, const Model::GetDefaultKeyReplicationRegionsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetDefaultKeyReplicationRegionsResponseReceivedHandler;
186191
typedef std::function<void(const PaymentCryptographyClient*, const Model::GetKeyRequest&, const Model::GetKeyOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetKeyResponseReceivedHandler;
187192
typedef std::function<void(const PaymentCryptographyClient*, const Model::GetParametersForExportRequest&, const Model::GetParametersForExportOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetParametersForExportResponseReceivedHandler;
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/payment-cryptography/PaymentCryptography_EXPORTS.h>
8+
#include <aws/core/utils/memory/stl/AWSString.h>
9+
#include <utility>
10+
11+
namespace Aws
12+
{
13+
namespace Utils
14+
{
15+
namespace Json
16+
{
17+
class JsonValue;
18+
class JsonView;
19+
} // namespace Json
20+
} // namespace Utils
21+
namespace PaymentCryptography
22+
{
23+
namespace Model
24+
{
25+
26+
/**
27+
* <p>Metadata used in generating the CSR</p><p><h3>See Also:</h3> <a
28+
* href="http://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/CertificateSubjectType">AWS
29+
* API Reference</a></p>
30+
*/
31+
class CertificateSubjectType
32+
{
33+
public:
34+
AWS_PAYMENTCRYPTOGRAPHY_API CertificateSubjectType() = default;
35+
AWS_PAYMENTCRYPTOGRAPHY_API CertificateSubjectType(Aws::Utils::Json::JsonView jsonValue);
36+
AWS_PAYMENTCRYPTOGRAPHY_API CertificateSubjectType& operator=(Aws::Utils::Json::JsonView jsonValue);
37+
AWS_PAYMENTCRYPTOGRAPHY_API Aws::Utils::Json::JsonValue Jsonize() const;
38+
39+
40+
///@{
41+
/**
42+
* <p>Common Name to be used in the certificate signing request</p>
43+
*/
44+
inline const Aws::String& GetCommonName() const { return m_commonName; }
45+
inline bool CommonNameHasBeenSet() const { return m_commonNameHasBeenSet; }
46+
template<typename CommonNameT = Aws::String>
47+
void SetCommonName(CommonNameT&& value) { m_commonNameHasBeenSet = true; m_commonName = std::forward<CommonNameT>(value); }
48+
template<typename CommonNameT = Aws::String>
49+
CertificateSubjectType& WithCommonName(CommonNameT&& value) { SetCommonName(std::forward<CommonNameT>(value)); return *this;}
50+
///@}
51+
52+
///@{
53+
/**
54+
* <p>Organization Unit to be used in the certificate signing request</p>
55+
*/
56+
inline const Aws::String& GetOrganizationUnit() const { return m_organizationUnit; }
57+
inline bool OrganizationUnitHasBeenSet() const { return m_organizationUnitHasBeenSet; }
58+
template<typename OrganizationUnitT = Aws::String>
59+
void SetOrganizationUnit(OrganizationUnitT&& value) { m_organizationUnitHasBeenSet = true; m_organizationUnit = std::forward<OrganizationUnitT>(value); }
60+
template<typename OrganizationUnitT = Aws::String>
61+
CertificateSubjectType& WithOrganizationUnit(OrganizationUnitT&& value) { SetOrganizationUnit(std::forward<OrganizationUnitT>(value)); return *this;}
62+
///@}
63+
64+
///@{
65+
/**
66+
* <p>Organization to be used in the certificate signing request</p>
67+
*/
68+
inline const Aws::String& GetOrganization() const { return m_organization; }
69+
inline bool OrganizationHasBeenSet() const { return m_organizationHasBeenSet; }
70+
template<typename OrganizationT = Aws::String>
71+
void SetOrganization(OrganizationT&& value) { m_organizationHasBeenSet = true; m_organization = std::forward<OrganizationT>(value); }
72+
template<typename OrganizationT = Aws::String>
73+
CertificateSubjectType& WithOrganization(OrganizationT&& value) { SetOrganization(std::forward<OrganizationT>(value)); return *this;}
74+
///@}
75+
76+
///@{
77+
/**
78+
* <p>City to be used in the certificate signing request</p>
79+
*/
80+
inline const Aws::String& GetCity() const { return m_city; }
81+
inline bool CityHasBeenSet() const { return m_cityHasBeenSet; }
82+
template<typename CityT = Aws::String>
83+
void SetCity(CityT&& value) { m_cityHasBeenSet = true; m_city = std::forward<CityT>(value); }
84+
template<typename CityT = Aws::String>
85+
CertificateSubjectType& WithCity(CityT&& value) { SetCity(std::forward<CityT>(value)); return *this;}
86+
///@}
87+
88+
///@{
89+
/**
90+
* <p>Country to be used in the certificate signing request</p>
91+
*/
92+
inline const Aws::String& GetCountry() const { return m_country; }
93+
inline bool CountryHasBeenSet() const { return m_countryHasBeenSet; }
94+
template<typename CountryT = Aws::String>
95+
void SetCountry(CountryT&& value) { m_countryHasBeenSet = true; m_country = std::forward<CountryT>(value); }
96+
template<typename CountryT = Aws::String>
97+
CertificateSubjectType& WithCountry(CountryT&& value) { SetCountry(std::forward<CountryT>(value)); return *this;}
98+
///@}
99+
100+
///@{
101+
/**
102+
* <p>State Or Province to be used in the certificate signing request</p>
103+
*/
104+
inline const Aws::String& GetStateOrProvince() const { return m_stateOrProvince; }
105+
inline bool StateOrProvinceHasBeenSet() const { return m_stateOrProvinceHasBeenSet; }
106+
template<typename StateOrProvinceT = Aws::String>
107+
void SetStateOrProvince(StateOrProvinceT&& value) { m_stateOrProvinceHasBeenSet = true; m_stateOrProvince = std::forward<StateOrProvinceT>(value); }
108+
template<typename StateOrProvinceT = Aws::String>
109+
CertificateSubjectType& WithStateOrProvince(StateOrProvinceT&& value) { SetStateOrProvince(std::forward<StateOrProvinceT>(value)); return *this;}
110+
///@}
111+
112+
///@{
113+
/**
114+
* <p>Email to be used in the certificate signing request</p>
115+
*/
116+
inline const Aws::String& GetEmailAddress() const { return m_emailAddress; }
117+
inline bool EmailAddressHasBeenSet() const { return m_emailAddressHasBeenSet; }
118+
template<typename EmailAddressT = Aws::String>
119+
void SetEmailAddress(EmailAddressT&& value) { m_emailAddressHasBeenSet = true; m_emailAddress = std::forward<EmailAddressT>(value); }
120+
template<typename EmailAddressT = Aws::String>
121+
CertificateSubjectType& WithEmailAddress(EmailAddressT&& value) { SetEmailAddress(std::forward<EmailAddressT>(value)); return *this;}
122+
///@}
123+
private:
124+
125+
Aws::String m_commonName;
126+
bool m_commonNameHasBeenSet = false;
127+
128+
Aws::String m_organizationUnit;
129+
bool m_organizationUnitHasBeenSet = false;
130+
131+
Aws::String m_organization;
132+
bool m_organizationHasBeenSet = false;
133+
134+
Aws::String m_city;
135+
bool m_cityHasBeenSet = false;
136+
137+
Aws::String m_country;
138+
bool m_countryHasBeenSet = false;
139+
140+
Aws::String m_stateOrProvince;
141+
bool m_stateOrProvinceHasBeenSet = false;
142+
143+
Aws::String m_emailAddress;
144+
bool m_emailAddressHasBeenSet = false;
145+
};
146+
147+
} // namespace Model
148+
} // namespace PaymentCryptography
149+
} // namespace Aws

generated/src/aws-cpp-sdk-payment-cryptography/include/aws/payment-cryptography/model/ExportTr34KeyBlock.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,30 @@ namespace Model
8383
ExportTr34KeyBlock& WithExportToken(ExportTokenT&& value) { SetExportToken(std::forward<ExportTokenT>(value)); return *this;}
8484
///@}
8585

86+
///@{
87+
/**
88+
* <p>Key Identifier used for signing the export key</p>
89+
*/
90+
inline const Aws::String& GetSigningKeyIdentifier() const { return m_signingKeyIdentifier; }
91+
inline bool SigningKeyIdentifierHasBeenSet() const { return m_signingKeyIdentifierHasBeenSet; }
92+
template<typename SigningKeyIdentifierT = Aws::String>
93+
void SetSigningKeyIdentifier(SigningKeyIdentifierT&& value) { m_signingKeyIdentifierHasBeenSet = true; m_signingKeyIdentifier = std::forward<SigningKeyIdentifierT>(value); }
94+
template<typename SigningKeyIdentifierT = Aws::String>
95+
ExportTr34KeyBlock& WithSigningKeyIdentifier(SigningKeyIdentifierT&& value) { SetSigningKeyIdentifier(std::forward<SigningKeyIdentifierT>(value)); return *this;}
96+
///@}
97+
98+
///@{
99+
/**
100+
* <p>Certificate used for signing the export key</p>
101+
*/
102+
inline const Aws::String& GetSigningKeyCertificate() const { return m_signingKeyCertificate; }
103+
inline bool SigningKeyCertificateHasBeenSet() const { return m_signingKeyCertificateHasBeenSet; }
104+
template<typename SigningKeyCertificateT = Aws::String>
105+
void SetSigningKeyCertificate(SigningKeyCertificateT&& value) { m_signingKeyCertificateHasBeenSet = true; m_signingKeyCertificate = std::forward<SigningKeyCertificateT>(value); }
106+
template<typename SigningKeyCertificateT = Aws::String>
107+
ExportTr34KeyBlock& WithSigningKeyCertificate(SigningKeyCertificateT&& value) { SetSigningKeyCertificate(std::forward<SigningKeyCertificateT>(value)); return *this;}
108+
///@}
109+
86110
///@{
87111
/**
88112
* <p>The format of key block that Amazon Web Services Payment Cryptography will
@@ -131,6 +155,12 @@ namespace Model
131155
Aws::String m_exportToken;
132156
bool m_exportTokenHasBeenSet = false;
133157

158+
Aws::String m_signingKeyIdentifier;
159+
bool m_signingKeyIdentifierHasBeenSet = false;
160+
161+
Aws::String m_signingKeyCertificate;
162+
bool m_signingKeyCertificateHasBeenSet = false;
163+
134164
Tr34KeyBlockFormat m_keyBlockFormat{Tr34KeyBlockFormat::NOT_SET};
135165
bool m_keyBlockFormatHasBeenSet = false;
136166

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/payment-cryptography/PaymentCryptography_EXPORTS.h>
8+
#include <aws/payment-cryptography/PaymentCryptographyRequest.h>
9+
#include <aws/core/utils/memory/stl/AWSString.h>
10+
#include <aws/payment-cryptography/model/SigningAlgorithmType.h>
11+
#include <aws/payment-cryptography/model/CertificateSubjectType.h>
12+
#include <utility>
13+
14+
namespace Aws
15+
{
16+
namespace PaymentCryptography
17+
{
18+
namespace Model
19+
{
20+
21+
/**
22+
*/
23+
class GetCertificateSigningRequestRequest : public PaymentCryptographyRequest
24+
{
25+
public:
26+
AWS_PAYMENTCRYPTOGRAPHY_API GetCertificateSigningRequestRequest() = default;
27+
28+
// Service request name is the Operation name which will send this request out,
29+
// each operation should has unique request name, so that we can get operation's name from this request.
30+
// Note: this is not true for response, multiple operations may have the same response name,
31+
// so we can not get operation's name from response.
32+
inline virtual const char* GetServiceRequestName() const override { return "GetCertificateSigningRequest"; }
33+
34+
AWS_PAYMENTCRYPTOGRAPHY_API Aws::String SerializePayload() const override;
35+
36+
AWS_PAYMENTCRYPTOGRAPHY_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
37+
38+
39+
///@{
40+
/**
41+
* <p>Asymmetric key used for generating the certificate signing request</p>
42+
*/
43+
inline const Aws::String& GetKeyIdentifier() const { return m_keyIdentifier; }
44+
inline bool KeyIdentifierHasBeenSet() const { return m_keyIdentifierHasBeenSet; }
45+
template<typename KeyIdentifierT = Aws::String>
46+
void SetKeyIdentifier(KeyIdentifierT&& value) { m_keyIdentifierHasBeenSet = true; m_keyIdentifier = std::forward<KeyIdentifierT>(value); }
47+
template<typename KeyIdentifierT = Aws::String>
48+
GetCertificateSigningRequestRequest& WithKeyIdentifier(KeyIdentifierT&& value) { SetKeyIdentifier(std::forward<KeyIdentifierT>(value)); return *this;}
49+
///@}
50+
51+
///@{
52+
/**
53+
* <p>Algorithm used to generate the certificate signing request</p>
54+
*/
55+
inline SigningAlgorithmType GetSigningAlgorithm() const { return m_signingAlgorithm; }
56+
inline bool SigningAlgorithmHasBeenSet() const { return m_signingAlgorithmHasBeenSet; }
57+
inline void SetSigningAlgorithm(SigningAlgorithmType value) { m_signingAlgorithmHasBeenSet = true; m_signingAlgorithm = value; }
58+
inline GetCertificateSigningRequestRequest& WithSigningAlgorithm(SigningAlgorithmType value) { SetSigningAlgorithm(value); return *this;}
59+
///@}
60+
61+
///@{
62+
/**
63+
* <p>Certificate subject data</p>
64+
*/
65+
inline const CertificateSubjectType& GetCertificateSubject() const { return m_certificateSubject; }
66+
inline bool CertificateSubjectHasBeenSet() const { return m_certificateSubjectHasBeenSet; }
67+
template<typename CertificateSubjectT = CertificateSubjectType>
68+
void SetCertificateSubject(CertificateSubjectT&& value) { m_certificateSubjectHasBeenSet = true; m_certificateSubject = std::forward<CertificateSubjectT>(value); }
69+
template<typename CertificateSubjectT = CertificateSubjectType>
70+
GetCertificateSigningRequestRequest& WithCertificateSubject(CertificateSubjectT&& value) { SetCertificateSubject(std::forward<CertificateSubjectT>(value)); return *this;}
71+
///@}
72+
private:
73+
74+
Aws::String m_keyIdentifier;
75+
bool m_keyIdentifierHasBeenSet = false;
76+
77+
SigningAlgorithmType m_signingAlgorithm{SigningAlgorithmType::NOT_SET};
78+
bool m_signingAlgorithmHasBeenSet = false;
79+
80+
CertificateSubjectType m_certificateSubject;
81+
bool m_certificateSubjectHasBeenSet = false;
82+
};
83+
84+
} // namespace Model
85+
} // namespace PaymentCryptography
86+
} // namespace Aws

0 commit comments

Comments
 (0)