Skip to content

Commit b1e1dfa

Browse files
Update generated code (#1728)
* update generated code * Fix CS --------- Co-authored-by: Jérémy Derussé <[email protected]>
1 parent d0f09bb commit b1e1dfa

File tree

11 files changed

+81
-16
lines changed

11 files changed

+81
-16
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variables": {
3-
"${LATEST}": "3.314.0"
3+
"${LATEST}": "3.314.1"
44
},
55
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
66
"services": {

psalm.baseline.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,13 @@
157157
<code>$items</code>
158158
<code>$items</code>
159159
<code>$items</code>
160+
<code>$items</code>
160161
</LessSpecificReturnStatement>
161162
<MoreSpecificReturnType>
162163
<code><![CDATA[list<EncryptionAlgorithmSpec::*>]]></code>
163164
<code><![CDATA[list<MacAlgorithmSpec::*>]]></code>
164165
<code><![CDATA[list<SigningAlgorithmSpec::*>]]></code>
166+
<code><![CDATA[list<KeyAgreementAlgorithmSpec::*>]]></code>
165167
</MoreSpecificReturnType>
166168
</file>
167169
<file src="src/Service/Lambda/src/Result/ListFunctionsResponse.php">

src/Service/Kms/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: This feature allows customers to use their keys stored in KMS to derive a shared secret which can then be used to establish a secured channel for communication, provide proof of possession, or establish trust with other parties.
8+
59
### Changed
610

711
- Add `Accept: application/json` header in request to fix incompatibility with 3rd party providers

src/Service/Kms/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"extra": {
3030
"branch-alias": {
31-
"dev-master": "1.4-dev"
31+
"dev-master": "1.5-dev"
3232
}
3333
}
3434
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace AsyncAws\Kms\Enum;
4+
5+
final class KeyAgreementAlgorithmSpec
6+
{
7+
public const ECDH = 'ECDH';
8+
9+
public static function exists(string $value): bool
10+
{
11+
return isset([
12+
self::ECDH => true,
13+
][$value]);
14+
}
15+
}

src/Service/Kms/src/Enum/KeyUsageType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ final class KeyUsageType
66
{
77
public const ENCRYPT_DECRYPT = 'ENCRYPT_DECRYPT';
88
public const GENERATE_VERIFY_MAC = 'GENERATE_VERIFY_MAC';
9+
public const KEY_AGREEMENT = 'KEY_AGREEMENT';
910
public const SIGN_VERIFY = 'SIGN_VERIFY';
1011

1112
public static function exists(string $value): bool
1213
{
1314
return isset([
1415
self::ENCRYPT_DECRYPT => true,
1516
self::GENERATE_VERIFY_MAC => true,
17+
self::KEY_AGREEMENT => true,
1618
self::SIGN_VERIFY => true,
1719
][$value]);
1820
}

src/Service/Kms/src/Exception/InvalidKeyUsageException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*
1414
* For encrypting, decrypting, re-encrypting, and generating data keys, the `KeyUsage` must be `ENCRYPT_DECRYPT`. For
1515
* signing and verifying messages, the `KeyUsage` must be `SIGN_VERIFY`. For generating and verifying message
16-
* authentication codes (MACs), the `KeyUsage` must be `GENERATE_VERIFY_MAC`. To find the `KeyUsage` of a KMS key, use
17-
* the DescribeKey operation.
16+
* authentication codes (MACs), the `KeyUsage` must be `GENERATE_VERIFY_MAC`. For deriving key agreement secrets, the
17+
* `KeyUsage` must be `KEY_AGREEMENT`. To find the `KeyUsage` of a KMS key, use the DescribeKey operation.
1818
*
1919
* To find the encryption or signing algorithms supported for a particular KMS key, use the DescribeKey operation.
2020
*/

src/Service/Kms/src/Input/CreateKeyRequest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ final class CreateKeyRequest extends Input
6767
*
6868
* - For symmetric encryption KMS keys, omit the parameter or specify `ENCRYPT_DECRYPT`.
6969
* - For HMAC KMS keys (symmetric), specify `GENERATE_VERIFY_MAC`.
70-
* - For asymmetric KMS keys with RSA key material, specify `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
71-
* - For asymmetric KMS keys with ECC key material, specify `SIGN_VERIFY`.
72-
* - For asymmetric KMS keys with SM2 key material (China Regions only), specify `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
70+
* - For asymmetric KMS keys with RSA key pairs, specify `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
71+
* - For asymmetric KMS keys with NIST-recommended elliptic curve key pairs, specify `SIGN_VERIFY` or `KEY_AGREEMENT`.
72+
* - For asymmetric KMS keys with `ECC_SECG_P256K1` key pairs specify `SIGN_VERIFY`.
73+
* - For asymmetric KMS keys with SM2 key pairs (China Regions only), specify `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or
74+
* `KEY_AGREEMENT`.
7375
*
7476
* [^1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations
7577
*
@@ -115,25 +117,25 @@ final class CreateKeyRequest extends Input
115117
* - `HMAC_384`
116118
* - `HMAC_512`
117119
*
118-
* - Asymmetric RSA key pairs
120+
* - Asymmetric RSA key pairs (encryption and decryption -or- signing and verification)
119121
*
120122
* - `RSA_2048`
121123
* - `RSA_3072`
122124
* - `RSA_4096`
123125
*
124-
* - Asymmetric NIST-recommended elliptic curve key pairs
126+
* - Asymmetric NIST-recommended elliptic curve key pairs (signing and verification -or- deriving shared secrets)
125127
*
126128
* - `ECC_NIST_P256` (secp256r1)
127129
* - `ECC_NIST_P384` (secp384r1)
128130
* - `ECC_NIST_P521` (secp521r1)
129131
*
130-
* - Other asymmetric elliptic curve key pairs
132+
* - Other asymmetric elliptic curve key pairs (signing and verification)
131133
*
132134
* - `ECC_SECG_P256K1` (secp256k1), commonly used for cryptocurrencies.
133135
*
134-
* - SM2 key pairs (China Regions only)
136+
* - SM2 key pairs (encryption and decryption -or- signing and verification -or- deriving shared secrets)
135137
*
136-
* - `SM2`
138+
* - `SM2` (China Regions only)
137139
*
138140
* [^1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-types.html#symm-asymm-choose
139141
* [^2]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm

src/Service/Kms/src/KmsClient.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,13 @@ public function createAlias($input): Result
183183
*
184184
* Asymmetric KMS keys contain an RSA key pair, Elliptic Curve (ECC) key pair, or an SM2 key pair (China Regions
185185
* only). The private key in an asymmetric KMS key never leaves KMS unencrypted. However, you can use the GetPublicKey
186-
* operation to download the public key so it can be used outside of KMS. KMS keys with RSA or SM2 key pairs can be
187-
* used to encrypt or decrypt data or sign and verify messages (but not both). KMS keys with ECC key pairs can be used
188-
* only to sign and verify messages. For information about asymmetric KMS keys, see Asymmetric KMS keys [^3] in the
189-
* *Key Management Service Developer Guide*.
186+
* operation to download the public key so it can be used outside of KMS. Each KMS key can have only one key usage.
187+
* KMS keys with RSA key pairs can be used to encrypt and decrypt data or sign and verify messages (but not both). KMS
188+
* keys with NIST-recommended ECC key pairs can be used to sign and verify messages or derive shared secrets (but not
189+
* both). KMS keys with `ECC_SECG_P256K1` can be used only to sign and verify messages. KMS keys with SM2 key pairs
190+
* (China Regions only) can be used to either encrypt and decrypt data, sign and verify messages, or derive shared
191+
* secrets (you must choose one key usage type). For information about asymmetric KMS keys, see Asymmetric KMS keys
192+
* [^3] in the *Key Management Service Developer Guide*.
190193
*
191194
* - `HMAC KMS key`:
192195
*

src/Service/Kms/src/Result/CreateKeyResponse.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use AsyncAws\Core\Response;
66
use AsyncAws\Core\Result;
77
use AsyncAws\Kms\Enum\EncryptionAlgorithmSpec;
8+
use AsyncAws\Kms\Enum\KeyAgreementAlgorithmSpec;
89
use AsyncAws\Kms\Enum\MacAlgorithmSpec;
910
use AsyncAws\Kms\Enum\SigningAlgorithmSpec;
1011
use AsyncAws\Kms\ValueObject\KeyMetadata;
@@ -51,6 +52,22 @@ private function populateResultEncryptionAlgorithmSpecList(array $json): array
5152
return $items;
5253
}
5354

55+
/**
56+
* @return list<KeyAgreementAlgorithmSpec::*>
57+
*/
58+
private function populateResultKeyAgreementAlgorithmSpecList(array $json): array
59+
{
60+
$items = [];
61+
foreach ($json as $item) {
62+
$a = isset($item) ? (string) $item : null;
63+
if (null !== $a) {
64+
$items[] = $a;
65+
}
66+
}
67+
68+
return $items;
69+
}
70+
5471
private function populateResultKeyMetadata(array $json): KeyMetadata
5572
{
5673
return new KeyMetadata([
@@ -73,6 +90,7 @@ private function populateResultKeyMetadata(array $json): KeyMetadata
7390
'KeySpec' => isset($json['KeySpec']) ? (string) $json['KeySpec'] : null,
7491
'EncryptionAlgorithms' => !isset($json['EncryptionAlgorithms']) ? null : $this->populateResultEncryptionAlgorithmSpecList($json['EncryptionAlgorithms']),
7592
'SigningAlgorithms' => !isset($json['SigningAlgorithms']) ? null : $this->populateResultSigningAlgorithmSpecList($json['SigningAlgorithms']),
93+
'KeyAgreementAlgorithms' => !isset($json['KeyAgreementAlgorithms']) ? null : $this->populateResultKeyAgreementAlgorithmSpecList($json['KeyAgreementAlgorithms']),
7694
'MultiRegion' => isset($json['MultiRegion']) ? filter_var($json['MultiRegion'], \FILTER_VALIDATE_BOOLEAN) : null,
7795
'MultiRegionConfiguration' => empty($json['MultiRegionConfiguration']) ? null : $this->populateResultMultiRegionConfiguration($json['MultiRegionConfiguration']),
7896
'PendingDeletionWindowInDays' => isset($json['PendingDeletionWindowInDays']) ? (int) $json['PendingDeletionWindowInDays'] : null,

0 commit comments

Comments
 (0)