Skip to content

Commit d2bfa63

Browse files
Additional support for managing HMAC keys that adheres to changes documented in X9.143-2021 and provides better interoperability for key import/export
1 parent 08618e4 commit d2bfa63

15 files changed

+79
-49
lines changed

generator/ServiceModels/payment-cryptography-data/payment-cryptography-data-2022-02-03.api.json

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@
371371
},
372372
"CipherTextType":{
373373
"type":"string",
374-
"max":4096,
374+
"max":4224,
375375
"min":2,
376376
"pattern":"(?:[0-9a-fA-F][0-9a-fA-F])+",
377377
"sensitive":true
@@ -486,15 +486,15 @@
486486
"DukptDerivationType"
487487
],
488488
"members":{
489-
"KeySerialNumber":{"shape":"HexLengthBetween10And24"},
489+
"KeySerialNumber":{"shape":"HexLength16Or20Or24"},
490490
"DukptDerivationType":{"shape":"DukptDerivationType"}
491491
}
492492
},
493493
"DukptDerivationAttributes":{
494494
"type":"structure",
495495
"required":["KeySerialNumber"],
496496
"members":{
497-
"KeySerialNumber":{"shape":"HexLengthBetween10And24"},
497+
"KeySerialNumber":{"shape":"HexLength16Or20Or24"},
498498
"DukptKeyDerivationType":{"shape":"DukptDerivationType"},
499499
"DukptKeyVariant":{"shape":"DukptKeyVariant"}
500500
}
@@ -513,7 +513,7 @@
513513
"type":"structure",
514514
"required":["KeySerialNumber"],
515515
"members":{
516-
"KeySerialNumber":{"shape":"HexLengthBetween10And24"},
516+
"KeySerialNumber":{"shape":"HexLength16Or20Or24"},
517517
"Mode":{"shape":"DukptEncryptionMode"},
518518
"DukptKeyDerivationType":{"shape":"DukptDerivationType"},
519519
"DukptKeyVariant":{"shape":"DukptKeyVariant"},
@@ -855,11 +855,11 @@
855855
"pattern":"(?:[0-9a-fA-F][0-9a-fA-F])+",
856856
"sensitive":true
857857
},
858-
"HexLengthBetween10And24":{
858+
"HexLength16Or20Or24":{
859859
"type":"string",
860860
"max":24,
861-
"min":10,
862-
"pattern":"[0-9a-fA-F]+"
861+
"min":16,
862+
"pattern":"(?:[0-9a-fA-F]{16}|[0-9a-fA-F]{20}|[0-9a-fA-F]{24})"
863863
},
864864
"HexLengthBetween2And4":{
865865
"type":"string",
@@ -1024,7 +1024,8 @@
10241024
"type":"string",
10251025
"enum":[
10261026
"CMAC",
1027-
"ANSI_X9_24"
1027+
"ANSI_X9_24",
1028+
"HMAC"
10281029
]
10291030
},
10301031
"KeyDerivationFunction":{
@@ -1061,7 +1062,7 @@
10611062
"DukptKeyVariant"
10621063
],
10631064
"members":{
1064-
"KeySerialNumber":{"shape":"HexLengthBetween10And24"},
1065+
"KeySerialNumber":{"shape":"HexLength16Or20Or24"},
10651066
"DukptKeyVariant":{"shape":"DukptKeyVariant"},
10661067
"DukptDerivationType":{"shape":"DukptDerivationType"}
10671068
}
@@ -1240,14 +1241,14 @@
12401241
},
12411242
"PlainTextOutputType":{
12421243
"type":"string",
1243-
"max":4096,
1244+
"max":4224,
12441245
"min":2,
12451246
"pattern":"(?:[0-9a-fA-F][0-9a-fA-F])+",
12461247
"sensitive":true
12471248
},
12481249
"PlainTextType":{
12491250
"type":"string",
1250-
"max":4064,
1251+
"max":4096,
12511252
"min":2,
12521253
"pattern":"(?:[0-9a-fA-F][0-9a-fA-F])+",
12531254
"sensitive":true
@@ -1450,7 +1451,11 @@
14501451
"TDES_3KEY",
14511452
"AES_128",
14521453
"AES_192",
1453-
"AES_256"
1454+
"AES_256",
1455+
"HMAC_SHA256",
1456+
"HMAC_SHA384",
1457+
"HMAC_SHA512",
1458+
"HMAC_SHA224"
14541459
]
14551460
},
14561461
"ThrottlingException":{

generator/ServiceModels/payment-cryptography-data/payment-cryptography-data-2022-02-03.docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
"TranslatePinDataInput$EncryptedPinBlock": "<p>The encrypted PIN block data that Amazon Web Services Payment Cryptography translates.</p>"
364364
}
365365
},
366-
"HexLengthBetween10And24": {
366+
"HexLength16Or20Or24": {
367367
"base": null,
368368
"refs": {
369369
"DukptAttributes$KeySerialNumber": "<p>The unique identifier known as Key Serial Number (KSN) that comes from an encrypting device using DUKPT encryption method. The KSN is derived from the encrypting device unique identifier and an internal transaction counter.</p>",

generator/ServiceModels/payment-cryptography-data/payment-cryptography-data-2022-02-03.normal.json

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@
480480
},
481481
"CipherTextType":{
482482
"type":"string",
483-
"max":4096,
483+
"max":4224,
484484
"min":2,
485485
"pattern":"(?:[0-9a-fA-F][0-9a-fA-F])+",
486486
"sensitive":true
@@ -666,7 +666,7 @@
666666
],
667667
"members":{
668668
"KeySerialNumber":{
669-
"shape":"HexLengthBetween10And24",
669+
"shape":"HexLength16Or20Or24",
670670
"documentation":"<p>The unique identifier known as Key Serial Number (KSN) that comes from an encrypting device using DUKPT encryption method. The KSN is derived from the encrypting device unique identifier and an internal transaction counter.</p>"
671671
},
672672
"DukptDerivationType":{
@@ -681,7 +681,7 @@
681681
"required":["KeySerialNumber"],
682682
"members":{
683683
"KeySerialNumber":{
684-
"shape":"HexLengthBetween10And24",
684+
"shape":"HexLength16Or20Or24",
685685
"documentation":"<p>The unique identifier known as Key Serial Number (KSN) that comes from an encrypting device using DUKPT encryption method. The KSN is derived from the encrypting device unique identifier and an internal transaction counter.</p>"
686686
},
687687
"DukptKeyDerivationType":{
@@ -710,7 +710,7 @@
710710
"required":["KeySerialNumber"],
711711
"members":{
712712
"KeySerialNumber":{
713-
"shape":"HexLengthBetween10And24",
713+
"shape":"HexLength16Or20Or24",
714714
"documentation":"<p>The unique identifier known as Key Serial Number (KSN) that comes from an encrypting device using DUKPT encryption method. The KSN is derived from the encrypting device unique identifier and an internal transaction counter.</p>"
715715
},
716716
"Mode":{
@@ -1318,11 +1318,11 @@
13181318
"pattern":"(?:[0-9a-fA-F][0-9a-fA-F])+",
13191319
"sensitive":true
13201320
},
1321-
"HexLengthBetween10And24":{
1321+
"HexLength16Or20Or24":{
13221322
"type":"string",
13231323
"max":24,
1324-
"min":10,
1325-
"pattern":"[0-9a-fA-F]+"
1324+
"min":16,
1325+
"pattern":"(?:[0-9a-fA-F]{16}|[0-9a-fA-F]{20}|[0-9a-fA-F]{24})"
13261326
},
13271327
"HexLengthBetween2And4":{
13281328
"type":"string",
@@ -1547,7 +1547,8 @@
15471547
"type":"string",
15481548
"enum":[
15491549
"CMAC",
1550-
"ANSI_X9_24"
1550+
"ANSI_X9_24",
1551+
"HMAC"
15511552
]
15521553
},
15531554
"KeyDerivationFunction":{
@@ -1585,7 +1586,7 @@
15851586
],
15861587
"members":{
15871588
"KeySerialNumber":{
1588-
"shape":"HexLengthBetween10And24",
1589+
"shape":"HexLength16Or20Or24",
15891590
"documentation":"<p>The unique identifier known as Key Serial Number (KSN) that comes from an encrypting device using DUKPT encryption method. The KSN is derived from the encrypting device unique identifier and an internal transaction counter.</p>"
15901591
},
15911592
"DukptKeyVariant":{
@@ -1851,14 +1852,14 @@
18511852
},
18521853
"PlainTextOutputType":{
18531854
"type":"string",
1854-
"max":4096,
1855+
"max":4224,
18551856
"min":2,
18561857
"pattern":"(?:[0-9a-fA-F][0-9a-fA-F])+",
18571858
"sensitive":true
18581859
},
18591860
"PlainTextType":{
18601861
"type":"string",
1861-
"max":4064,
1862+
"max":4096,
18621863
"min":2,
18631864
"pattern":"(?:[0-9a-fA-F][0-9a-fA-F])+",
18641865
"sensitive":true
@@ -2177,7 +2178,11 @@
21772178
"TDES_3KEY",
21782179
"AES_128",
21792180
"AES_192",
2180-
"AES_256"
2181+
"AES_256",
2182+
"HMAC_SHA256",
2183+
"HMAC_SHA384",
2184+
"HMAC_SHA512",
2185+
"HMAC_SHA224"
21812186
]
21822187
},
21832188
"ThrottlingException":{

sdk/code-analysis/ServiceAnalysis/PaymentCryptographyData/Generated/PropertyValueRules.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<property-value-rule>
44
<property>Amazon.PaymentCryptographyData.Model.DecryptDataRequest.CipherText</property>
55
<min>2</min>
6-
<max>4096</max>
6+
<max>4224</max>
77
<pattern>(?:[0-9a-fA-F][0-9a-fA-F])+</pattern>
88
</property-value-rule>
99
<property-value-rule>
@@ -27,7 +27,7 @@
2727
<property-value-rule>
2828
<property>Amazon.PaymentCryptographyData.Model.DecryptDataResponse.PlainText</property>
2929
<min>2</min>
30-
<max>4096</max>
30+
<max>4224</max>
3131
<pattern>(?:[0-9a-fA-F][0-9a-fA-F])+</pattern>
3232
</property-value-rule>
3333
<property-value-rule>
@@ -39,13 +39,13 @@
3939
<property-value-rule>
4040
<property>Amazon.PaymentCryptographyData.Model.EncryptDataRequest.PlainText</property>
4141
<min>2</min>
42-
<max>4064</max>
42+
<max>4096</max>
4343
<pattern>(?:[0-9a-fA-F][0-9a-fA-F])+</pattern>
4444
</property-value-rule>
4545
<property-value-rule>
4646
<property>Amazon.PaymentCryptographyData.Model.EncryptDataResponse.CipherText</property>
4747
<min>2</min>
48-
<max>4096</max>
48+
<max>4224</max>
4949
<pattern>(?:[0-9a-fA-F][0-9a-fA-F])+</pattern>
5050
</property-value-rule>
5151
<property-value-rule>
@@ -264,7 +264,7 @@
264264
<property-value-rule>
265265
<property>Amazon.PaymentCryptographyData.Model.ReEncryptDataRequest.CipherText</property>
266266
<min>2</min>
267-
<max>4096</max>
267+
<max>4224</max>
268268
<pattern>(?:[0-9a-fA-F][0-9a-fA-F])+</pattern>
269269
</property-value-rule>
270270
<property-value-rule>
@@ -282,7 +282,7 @@
282282
<property-value-rule>
283283
<property>Amazon.PaymentCryptographyData.Model.ReEncryptDataResponse.CipherText</property>
284284
<min>2</min>
285-
<max>4096</max>
285+
<max>4224</max>
286286
<pattern>(?:[0-9a-fA-F][0-9a-fA-F])+</pattern>
287287
</property-value-rule>
288288
<property-value-rule>
@@ -615,15 +615,15 @@
615615
</property-value-rule>
616616
<property-value-rule>
617617
<property>Amazon.PaymentCryptographyData.Model.DukptAttributes.KeySerialNumber</property>
618-
<min>10</min>
618+
<min>16</min>
619619
<max>24</max>
620-
<pattern>[0-9a-fA-F]+</pattern>
620+
<pattern>(?:[0-9a-fA-F]{16}|[0-9a-fA-F]{20}|[0-9a-fA-F]{24})</pattern>
621621
</property-value-rule>
622622
<property-value-rule>
623623
<property>Amazon.PaymentCryptographyData.Model.DukptDerivationAttributes.KeySerialNumber</property>
624-
<min>10</min>
624+
<min>16</min>
625625
<max>24</max>
626-
<pattern>[0-9a-fA-F]+</pattern>
626+
<pattern>(?:[0-9a-fA-F]{16}|[0-9a-fA-F]{20}|[0-9a-fA-F]{24})</pattern>
627627
</property-value-rule>
628628
<property-value-rule>
629629
<property>Amazon.PaymentCryptographyData.Model.DukptEncryptionAttributes.InitializationVector</property>
@@ -633,9 +633,9 @@
633633
</property-value-rule>
634634
<property-value-rule>
635635
<property>Amazon.PaymentCryptographyData.Model.DukptEncryptionAttributes.KeySerialNumber</property>
636-
<min>10</min>
636+
<min>16</min>
637637
<max>24</max>
638-
<pattern>[0-9a-fA-F]+</pattern>
638+
<pattern>(?:[0-9a-fA-F]{16}|[0-9a-fA-F]{20}|[0-9a-fA-F]{24})</pattern>
639639
</property-value-rule>
640640
<property-value-rule>
641641
<property>Amazon.PaymentCryptographyData.Model.DynamicCardVerificationCode.ApplicationTransactionCounter</property>
@@ -873,9 +873,9 @@
873873
</property-value-rule>
874874
<property-value-rule>
875875
<property>Amazon.PaymentCryptographyData.Model.MacAlgorithmDukpt.KeySerialNumber</property>
876-
<min>10</min>
876+
<min>16</min>
877877
<max>24</max>
878-
<pattern>[0-9a-fA-F]+</pattern>
878+
<pattern>(?:[0-9a-fA-F]{16}|[0-9a-fA-F]{20}|[0-9a-fA-F]{24})</pattern>
879879
</property-value-rule>
880880
<property-value-rule>
881881
<property>Amazon.PaymentCryptographyData.Model.MacAlgorithmEmv.PanSequenceNumber</property>

sdk/src/Services/PaymentCryptographyData/Generated/Model/DecryptDataRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public partial class DecryptDataRequest : AmazonPaymentCryptographyDataRequest
114114
/// The ciphertext to decrypt.
115115
/// </para>
116116
/// </summary>
117-
[AWSProperty(Required=true, Sensitive=true, Min=2, Max=4096)]
117+
[AWSProperty(Required=true, Sensitive=true, Min=2, Max=4224)]
118118
public string CipherText
119119
{
120120
get { return this._cipherText; }

sdk/src/Services/PaymentCryptographyData/Generated/Model/DecryptDataResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ internal bool IsSetKeyCheckValue()
8888
/// The decrypted plaintext data in hexBinary format.
8989
/// </para>
9090
/// </summary>
91-
[AWSProperty(Required=true, Sensitive=true, Min=2, Max=4096)]
91+
[AWSProperty(Required=true, Sensitive=true, Min=2, Max=4224)]
9292
public string PlainText
9393
{
9494
get { return this._plainText; }

sdk/src/Services/PaymentCryptographyData/Generated/Model/DukptAttributes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ internal bool IsSetDukptDerivationType()
6767
/// unique identifier and an internal transaction counter.
6868
/// </para>
6969
/// </summary>
70-
[AWSProperty(Required=true, Min=10, Max=24)]
70+
[AWSProperty(Required=true, Min=16, Max=24)]
7171
public string KeySerialNumber
7272
{
7373
get { return this._keySerialNumber; }

sdk/src/Services/PaymentCryptographyData/Generated/Model/DukptDerivationAttributes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ internal bool IsSetDukptKeyVariant()
8686
/// unique identifier and an internal transaction counter.
8787
/// </para>
8888
/// </summary>
89-
[AWSProperty(Required=true, Min=10, Max=24)]
89+
[AWSProperty(Required=true, Min=16, Max=24)]
9090
public string KeySerialNumber
9191
{
9292
get { return this._keySerialNumber; }

sdk/src/Services/PaymentCryptographyData/Generated/Model/DukptEncryptionAttributes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ internal bool IsSetInitializationVector()
108108
/// unique identifier and an internal transaction counter.
109109
/// </para>
110110
/// </summary>
111-
[AWSProperty(Required=true, Min=10, Max=24)]
111+
[AWSProperty(Required=true, Min=16, Max=24)]
112112
public string KeySerialNumber
113113
{
114114
get { return this._keySerialNumber; }

sdk/src/Services/PaymentCryptographyData/Generated/Model/EncryptDataRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ internal bool IsSetKeyIdentifier()
182182
/// </para>
183183
/// </note>
184184
/// </summary>
185-
[AWSProperty(Required=true, Sensitive=true, Min=2, Max=4064)]
185+
[AWSProperty(Required=true, Sensitive=true, Min=2, Max=4096)]
186186
public string PlainText
187187
{
188188
get { return this._plainText; }

0 commit comments

Comments
 (0)