-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
api.go
7863 lines (6897 loc) · 282 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package paymentcryptographydata
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
)
const opDecryptData = "DecryptData"
// DecryptDataRequest generates a "aws/request.Request" representing the
// client's request for the DecryptData operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DecryptData for more information on using the DecryptData
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the DecryptDataRequest method.
// req, resp := client.DecryptDataRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/DecryptData
func (c *PaymentCryptographyData) DecryptDataRequest(input *DecryptDataInput) (req *request.Request, output *DecryptDataOutput) {
op := &request.Operation{
Name: opDecryptData,
HTTPMethod: "POST",
HTTPPath: "/keys/{KeyIdentifier}/decrypt",
}
if input == nil {
input = &DecryptDataInput{}
}
output = &DecryptDataOutput{}
req = c.newRequest(op, input, output)
return
}
// DecryptData API operation for Payment Cryptography Data Plane.
//
// Decrypts ciphertext data to plaintext using a symmetric (TDES, AES), asymmetric
// (RSA), or derived (DUKPT or EMV) encryption key scheme. For more information,
// see Decrypt data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/decrypt-data.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// You can use an encryption key generated within Amazon Web Services Payment
// Cryptography, or you can import your own encryption key by calling ImportKey
// (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html).
// For this operation, the key must have KeyModesOfUse set to Decrypt. In asymmetric
// decryption, Amazon Web Services Payment Cryptography decrypts the ciphertext
// using the private component of the asymmetric encryption key pair. For data
// encryption outside of Amazon Web Services Payment Cryptography, you can export
// the public component of the asymmetric key pair by calling GetPublicCertificate
// (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html).
//
// For symmetric and DUKPT decryption, Amazon Web Services Payment Cryptography
// supports TDES and AES algorithms. For EMV decryption, Amazon Web Services
// Payment Cryptography supports TDES algorithms. For asymmetric decryption,
// Amazon Web Services Payment Cryptography supports RSA.
//
// When you use TDES or TDES DUKPT, the ciphertext data length must be a multiple
// of 8 bytes. For AES or AES DUKPT, the ciphertext data length must be a multiple
// of 16 bytes. For RSA, it sould be equal to the key size unless padding is
// enabled.
//
// For information about valid keys for this operation, see Understanding key
// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html)
// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// Cross-account use: This operation can't be used across different Amazon Web
// Services accounts.
//
// Related operations:
//
// - EncryptData
//
// - GetPublicCertificate (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html)
//
// - ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html)
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Payment Cryptography Data Plane's
// API operation DecryptData for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// The request was denied due to an invalid request error.
//
// - AccessDeniedException
// You do not have sufficient access to perform this action.
//
// - ResourceNotFoundException
// The request was denied due to an invalid resource error.
//
// - ThrottlingException
// The request was denied due to request throttling.
//
// - InternalServerException
// The request processing has failed because of an unknown error, exception,
// or failure.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/DecryptData
func (c *PaymentCryptographyData) DecryptData(input *DecryptDataInput) (*DecryptDataOutput, error) {
req, out := c.DecryptDataRequest(input)
return out, req.Send()
}
// DecryptDataWithContext is the same as DecryptData with the addition of
// the ability to pass a context and additional request options.
//
// See DecryptData for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *PaymentCryptographyData) DecryptDataWithContext(ctx aws.Context, input *DecryptDataInput, opts ...request.Option) (*DecryptDataOutput, error) {
req, out := c.DecryptDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opEncryptData = "EncryptData"
// EncryptDataRequest generates a "aws/request.Request" representing the
// client's request for the EncryptData operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See EncryptData for more information on using the EncryptData
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the EncryptDataRequest method.
// req, resp := client.EncryptDataRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/EncryptData
func (c *PaymentCryptographyData) EncryptDataRequest(input *EncryptDataInput) (req *request.Request, output *EncryptDataOutput) {
op := &request.Operation{
Name: opEncryptData,
HTTPMethod: "POST",
HTTPPath: "/keys/{KeyIdentifier}/encrypt",
}
if input == nil {
input = &EncryptDataInput{}
}
output = &EncryptDataOutput{}
req = c.newRequest(op, input, output)
return
}
// EncryptData API operation for Payment Cryptography Data Plane.
//
// Encrypts plaintext data to ciphertext using a symmetric (TDES, AES), asymmetric
// (RSA), or derived (DUKPT or EMV) encryption key scheme. For more information,
// see Encrypt data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// You can generate an encryption key within Amazon Web Services Payment Cryptography
// by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html).
// You can import your own encryption key by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html).
// For this operation, the key must have KeyModesOfUse set to Encrypt. In asymmetric
// encryption, plaintext is encrypted using public component. You can import
// the public component of an asymmetric key pair created outside Amazon Web
// Services Payment Cryptography by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html).
//
// For symmetric and DUKPT encryption, Amazon Web Services Payment Cryptography
// supports TDES and AES algorithms. For EMV encryption, Amazon Web Services
// Payment Cryptography supports TDES algorithms.For asymmetric encryption,
// Amazon Web Services Payment Cryptography supports RSA.
//
// When you use TDES or TDES DUKPT, the plaintext data length must be a multiple
// of 8 bytes. For AES or AES DUKPT, the plaintext data length must be a multiple
// of 16 bytes. For RSA, it sould be equal to the key size unless padding is
// enabled.
//
// To encrypt using DUKPT, you must already have a BDK (Base Derivation Key)
// key in your account with KeyModesOfUse set to DeriveKey, or you can generate
// a new DUKPT key by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html).
// To encrypt using EMV, you must already have an IMK (Issuer Master Key) key
// in your account with KeyModesOfUse set to DeriveKey.
//
// For information about valid keys for this operation, see Understanding key
// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html)
// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// Cross-account use: This operation can't be used across different Amazon Web
// Services accounts.
//
// Related operations:
//
// - DecryptData
//
// - GetPublicCertificate (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html)
//
// - ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html)
//
// - ReEncryptData
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Payment Cryptography Data Plane's
// API operation EncryptData for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// The request was denied due to an invalid request error.
//
// - AccessDeniedException
// You do not have sufficient access to perform this action.
//
// - ResourceNotFoundException
// The request was denied due to an invalid resource error.
//
// - ThrottlingException
// The request was denied due to request throttling.
//
// - InternalServerException
// The request processing has failed because of an unknown error, exception,
// or failure.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/EncryptData
func (c *PaymentCryptographyData) EncryptData(input *EncryptDataInput) (*EncryptDataOutput, error) {
req, out := c.EncryptDataRequest(input)
return out, req.Send()
}
// EncryptDataWithContext is the same as EncryptData with the addition of
// the ability to pass a context and additional request options.
//
// See EncryptData for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *PaymentCryptographyData) EncryptDataWithContext(ctx aws.Context, input *EncryptDataInput, opts ...request.Option) (*EncryptDataOutput, error) {
req, out := c.EncryptDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGenerateCardValidationData = "GenerateCardValidationData"
// GenerateCardValidationDataRequest generates a "aws/request.Request" representing the
// client's request for the GenerateCardValidationData operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GenerateCardValidationData for more information on using the GenerateCardValidationData
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the GenerateCardValidationDataRequest method.
// req, resp := client.GenerateCardValidationDataRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GenerateCardValidationData
func (c *PaymentCryptographyData) GenerateCardValidationDataRequest(input *GenerateCardValidationDataInput) (req *request.Request, output *GenerateCardValidationDataOutput) {
op := &request.Operation{
Name: opGenerateCardValidationData,
HTTPMethod: "POST",
HTTPPath: "/cardvalidationdata/generate",
}
if input == nil {
input = &GenerateCardValidationDataInput{}
}
output = &GenerateCardValidationDataOutput{}
req = c.newRequest(op, input, output)
return
}
// GenerateCardValidationData API operation for Payment Cryptography Data Plane.
//
// Generates card-related validation data using algorithms such as Card Verification
// Values (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2), or Card
// Security Codes (CSC). For more information, see Generate card data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/generate-card-data.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// This operation generates a CVV or CSC value that is printed on a payment
// credit or debit card during card production. The CVV or CSC, PAN (Primary
// Account Number) and expiration date of the card are required to check its
// validity during transaction processing. To begin this operation, a CVK (Card
// Verification Key) encryption key is required. You can use CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html)
// or ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html)
// to establish a CVK within Amazon Web Services Payment Cryptography. The KeyModesOfUse
// should be set to Generate and Verify for a CVK encryption key.
//
// For information about valid keys for this operation, see Understanding key
// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html)
// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// Cross-account use: This operation can't be used across different Amazon Web
// Services accounts.
//
// Related operations:
//
// - ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html)
//
// - VerifyCardValidationData
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Payment Cryptography Data Plane's
// API operation GenerateCardValidationData for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// The request was denied due to an invalid request error.
//
// - AccessDeniedException
// You do not have sufficient access to perform this action.
//
// - ResourceNotFoundException
// The request was denied due to an invalid resource error.
//
// - ThrottlingException
// The request was denied due to request throttling.
//
// - InternalServerException
// The request processing has failed because of an unknown error, exception,
// or failure.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GenerateCardValidationData
func (c *PaymentCryptographyData) GenerateCardValidationData(input *GenerateCardValidationDataInput) (*GenerateCardValidationDataOutput, error) {
req, out := c.GenerateCardValidationDataRequest(input)
return out, req.Send()
}
// GenerateCardValidationDataWithContext is the same as GenerateCardValidationData with the addition of
// the ability to pass a context and additional request options.
//
// See GenerateCardValidationData for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *PaymentCryptographyData) GenerateCardValidationDataWithContext(ctx aws.Context, input *GenerateCardValidationDataInput, opts ...request.Option) (*GenerateCardValidationDataOutput, error) {
req, out := c.GenerateCardValidationDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGenerateMac = "GenerateMac"
// GenerateMacRequest generates a "aws/request.Request" representing the
// client's request for the GenerateMac operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GenerateMac for more information on using the GenerateMac
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the GenerateMacRequest method.
// req, resp := client.GenerateMacRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GenerateMac
func (c *PaymentCryptographyData) GenerateMacRequest(input *GenerateMacInput) (req *request.Request, output *GenerateMacOutput) {
op := &request.Operation{
Name: opGenerateMac,
HTTPMethod: "POST",
HTTPPath: "/mac/generate",
}
if input == nil {
input = &GenerateMacInput{}
}
output = &GenerateMacOutput{}
req = c.newRequest(op, input, output)
return
}
// GenerateMac API operation for Payment Cryptography Data Plane.
//
// Generates a Message Authentication Code (MAC) cryptogram within Amazon Web
// Services Payment Cryptography.
//
// You can use this operation to authenticate card-related data by using known
// data values to generate MAC for data validation between the sending and receiving
// parties. This operation uses message data, a secret encryption key and MAC
// algorithm to generate a unique MAC value for transmission. The receiving
// party of the MAC must use the same message data, secret encryption key and
// MAC algorithm to reproduce another MAC value for comparision.
//
// You can use this operation to generate a DUPKT, CMAC, HMAC or EMV MAC by
// setting generation attributes and algorithm to the associated values. The
// MAC generation encryption key must have valid values for KeyUsage such as
// TR31_M7_HMAC_KEY for HMAC generation, and they key must have KeyModesOfUse
// set to Generate and Verify.
//
// For information about valid keys for this operation, see Understanding key
// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html)
// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// Cross-account use: This operation can't be used across different Amazon Web
// Services accounts.
//
// Related operations:
//
// - VerifyMac
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Payment Cryptography Data Plane's
// API operation GenerateMac for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// The request was denied due to an invalid request error.
//
// - AccessDeniedException
// You do not have sufficient access to perform this action.
//
// - ResourceNotFoundException
// The request was denied due to an invalid resource error.
//
// - ThrottlingException
// The request was denied due to request throttling.
//
// - InternalServerException
// The request processing has failed because of an unknown error, exception,
// or failure.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GenerateMac
func (c *PaymentCryptographyData) GenerateMac(input *GenerateMacInput) (*GenerateMacOutput, error) {
req, out := c.GenerateMacRequest(input)
return out, req.Send()
}
// GenerateMacWithContext is the same as GenerateMac with the addition of
// the ability to pass a context and additional request options.
//
// See GenerateMac for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *PaymentCryptographyData) GenerateMacWithContext(ctx aws.Context, input *GenerateMacInput, opts ...request.Option) (*GenerateMacOutput, error) {
req, out := c.GenerateMacRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGeneratePinData = "GeneratePinData"
// GeneratePinDataRequest generates a "aws/request.Request" representing the
// client's request for the GeneratePinData operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GeneratePinData for more information on using the GeneratePinData
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the GeneratePinDataRequest method.
// req, resp := client.GeneratePinDataRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GeneratePinData
func (c *PaymentCryptographyData) GeneratePinDataRequest(input *GeneratePinDataInput) (req *request.Request, output *GeneratePinDataOutput) {
op := &request.Operation{
Name: opGeneratePinData,
HTTPMethod: "POST",
HTTPPath: "/pindata/generate",
}
if input == nil {
input = &GeneratePinDataInput{}
}
output = &GeneratePinDataOutput{}
req = c.newRequest(op, input, output)
return
}
// GeneratePinData API operation for Payment Cryptography Data Plane.
//
// Generates pin-related data such as PIN, PIN Verification Value (PVV), PIN
// Block, and PIN Offset during new card issuance or reissuance. For more information,
// see Generate PIN data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/generate-pin-data.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// PIN data is never transmitted in clear to or from Amazon Web Services Payment
// Cryptography. This operation generates PIN, PVV, or PIN Offset and then encrypts
// it using Pin Encryption Key (PEK) to create an EncryptedPinBlock for transmission
// from Amazon Web Services Payment Cryptography. This operation uses a separate
// Pin Verification Key (PVK) for VISA PVV generation.
//
// For information about valid keys for this operation, see Understanding key
// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html)
// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// Cross-account use: This operation can't be used across different Amazon Web
// Services accounts.
//
// Related operations:
//
// - GenerateCardValidationData
//
// - TranslatePinData
//
// - VerifyPinData
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Payment Cryptography Data Plane's
// API operation GeneratePinData for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// The request was denied due to an invalid request error.
//
// - AccessDeniedException
// You do not have sufficient access to perform this action.
//
// - ResourceNotFoundException
// The request was denied due to an invalid resource error.
//
// - ThrottlingException
// The request was denied due to request throttling.
//
// - InternalServerException
// The request processing has failed because of an unknown error, exception,
// or failure.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GeneratePinData
func (c *PaymentCryptographyData) GeneratePinData(input *GeneratePinDataInput) (*GeneratePinDataOutput, error) {
req, out := c.GeneratePinDataRequest(input)
return out, req.Send()
}
// GeneratePinDataWithContext is the same as GeneratePinData with the addition of
// the ability to pass a context and additional request options.
//
// See GeneratePinData for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *PaymentCryptographyData) GeneratePinDataWithContext(ctx aws.Context, input *GeneratePinDataInput, opts ...request.Option) (*GeneratePinDataOutput, error) {
req, out := c.GeneratePinDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opReEncryptData = "ReEncryptData"
// ReEncryptDataRequest generates a "aws/request.Request" representing the
// client's request for the ReEncryptData operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ReEncryptData for more information on using the ReEncryptData
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the ReEncryptDataRequest method.
// req, resp := client.ReEncryptDataRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/ReEncryptData
func (c *PaymentCryptographyData) ReEncryptDataRequest(input *ReEncryptDataInput) (req *request.Request, output *ReEncryptDataOutput) {
op := &request.Operation{
Name: opReEncryptData,
HTTPMethod: "POST",
HTTPPath: "/keys/{IncomingKeyIdentifier}/reencrypt",
}
if input == nil {
input = &ReEncryptDataInput{}
}
output = &ReEncryptDataOutput{}
req = c.newRequest(op, input, output)
return
}
// ReEncryptData API operation for Payment Cryptography Data Plane.
//
// Re-encrypt ciphertext using DUKPT, Symmetric and Asymmetric Data Encryption
// Keys.
//
// You can either generate an encryption key within Amazon Web Services Payment
// Cryptography by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html)
// or import your own encryption key by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html).
// The KeyArn for use with this operation must be in a compatible key state
// with KeyModesOfUse set to Encrypt. In asymmetric encryption, ciphertext is
// encrypted using public component (imported by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html))
// of the asymmetric key pair created outside of Amazon Web Services Payment
// Cryptography.
//
// For symmetric and DUKPT encryption, Amazon Web Services Payment Cryptography
// supports TDES and AES algorithms. For asymmetric encryption, Amazon Web Services
// Payment Cryptography supports RSA. To encrypt using DUKPT, a DUKPT key must
// already exist within your account with KeyModesOfUse set to DeriveKey or
// a new DUKPT can be generated by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html).
//
// For information about valid keys for this operation, see Understanding key
// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html)
// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// Cross-account use: This operation can't be used across different Amazon Web
// Services accounts.
//
// Related operations:
//
// - DecryptData
//
// - EncryptData
//
// - GetPublicCertificate (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html)
//
// - ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html)
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Payment Cryptography Data Plane's
// API operation ReEncryptData for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// The request was denied due to an invalid request error.
//
// - AccessDeniedException
// You do not have sufficient access to perform this action.
//
// - ResourceNotFoundException
// The request was denied due to an invalid resource error.
//
// - ThrottlingException
// The request was denied due to request throttling.
//
// - InternalServerException
// The request processing has failed because of an unknown error, exception,
// or failure.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/ReEncryptData
func (c *PaymentCryptographyData) ReEncryptData(input *ReEncryptDataInput) (*ReEncryptDataOutput, error) {
req, out := c.ReEncryptDataRequest(input)
return out, req.Send()
}
// ReEncryptDataWithContext is the same as ReEncryptData with the addition of
// the ability to pass a context and additional request options.
//
// See ReEncryptData for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *PaymentCryptographyData) ReEncryptDataWithContext(ctx aws.Context, input *ReEncryptDataInput, opts ...request.Option) (*ReEncryptDataOutput, error) {
req, out := c.ReEncryptDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opTranslatePinData = "TranslatePinData"
// TranslatePinDataRequest generates a "aws/request.Request" representing the
// client's request for the TranslatePinData operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See TranslatePinData for more information on using the TranslatePinData
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the TranslatePinDataRequest method.
// req, resp := client.TranslatePinDataRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/TranslatePinData
func (c *PaymentCryptographyData) TranslatePinDataRequest(input *TranslatePinDataInput) (req *request.Request, output *TranslatePinDataOutput) {
op := &request.Operation{
Name: opTranslatePinData,
HTTPMethod: "POST",
HTTPPath: "/pindata/translate",
}
if input == nil {
input = &TranslatePinDataInput{}
}
output = &TranslatePinDataOutput{}
req = c.newRequest(op, input, output)
return
}
// TranslatePinData API operation for Payment Cryptography Data Plane.
//
// Translates encrypted PIN block from and to ISO 9564 formats 0,1,3,4. For
// more information, see Translate PIN data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/translate-pin-data.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// PIN block translation involves changing the encrytion of PIN block from one
// encryption key to another encryption key and changing PIN block format from
// one to another without PIN block data leaving Amazon Web Services Payment
// Cryptography. The encryption key transformation can be from PEK (Pin Encryption
// Key) to BDK (Base Derivation Key) for DUKPT or from BDK for DUKPT to PEK.
// Amazon Web Services Payment Cryptography supports TDES and AES key derivation
// type for DUKPT translations.
//
// The allowed combinations of PIN block format translations are guided by PCI.
// It is important to note that not all encrypted PIN block formats (example,
// format 1) require PAN (Primary Account Number) as input. And as such, PIN
// block format that requires PAN (example, formats 0,3,4) cannot be translated
// to a format (format 1) that does not require a PAN for generation.
//
// For information about valid keys for this operation, see Understanding key
// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html)
// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// Amazon Web Services Payment Cryptography currently supports ISO PIN block
// 4 translation for PIN block built using legacy PAN length. That is, PAN is
// the right most 12 digits excluding the check digits.
//
// Cross-account use: This operation can't be used across different Amazon Web
// Services accounts.
//
// Related operations:
//
// - GeneratePinData
//
// - VerifyPinData
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Payment Cryptography Data Plane's
// API operation TranslatePinData for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// The request was denied due to an invalid request error.
//
// - AccessDeniedException
// You do not have sufficient access to perform this action.
//
// - ResourceNotFoundException
// The request was denied due to an invalid resource error.
//
// - ThrottlingException
// The request was denied due to request throttling.
//
// - InternalServerException
// The request processing has failed because of an unknown error, exception,
// or failure.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/TranslatePinData
func (c *PaymentCryptographyData) TranslatePinData(input *TranslatePinDataInput) (*TranslatePinDataOutput, error) {
req, out := c.TranslatePinDataRequest(input)
return out, req.Send()
}
// TranslatePinDataWithContext is the same as TranslatePinData with the addition of
// the ability to pass a context and additional request options.
//
// See TranslatePinData for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *PaymentCryptographyData) TranslatePinDataWithContext(ctx aws.Context, input *TranslatePinDataInput, opts ...request.Option) (*TranslatePinDataOutput, error) {
req, out := c.TranslatePinDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opVerifyAuthRequestCryptogram = "VerifyAuthRequestCryptogram"
// VerifyAuthRequestCryptogramRequest generates a "aws/request.Request" representing the
// client's request for the VerifyAuthRequestCryptogram operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See VerifyAuthRequestCryptogram for more information on using the VerifyAuthRequestCryptogram
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the VerifyAuthRequestCryptogramRequest method.
// req, resp := client.VerifyAuthRequestCryptogramRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram
func (c *PaymentCryptographyData) VerifyAuthRequestCryptogramRequest(input *VerifyAuthRequestCryptogramInput) (req *request.Request, output *VerifyAuthRequestCryptogramOutput) {
op := &request.Operation{
Name: opVerifyAuthRequestCryptogram,
HTTPMethod: "POST",
HTTPPath: "/cryptogram/verify",
}
if input == nil {
input = &VerifyAuthRequestCryptogramInput{}
}
output = &VerifyAuthRequestCryptogramOutput{}
req = c.newRequest(op, input, output)
return
}
// VerifyAuthRequestCryptogram API operation for Payment Cryptography Data Plane.
//
// Verifies Authorization Request Cryptogram (ARQC) for a EMV chip payment card
// authorization. For more information, see Verify auth request cryptogram (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/data-operations.verifyauthrequestcryptogram.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// ARQC generation is done outside of Amazon Web Services Payment Cryptography
// and is typically generated on a point of sale terminal for an EMV chip card
// to obtain payment authorization during transaction time. For ARQC verification,
// you must first import the ARQC generated outside of Amazon Web Services Payment
// Cryptography by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html).
// This operation uses the imported ARQC and an major encryption key (DUKPT)
// created by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html)
// to either provide a boolean ARQC verification result or provide an APRC (Authorization
// Response Cryptogram) response using Method 1 or Method 2. The ARPC_METHOD_1
// uses AuthResponseCode to generate ARPC and ARPC_METHOD_2 uses CardStatusUpdate
// to generate ARPC.
//
// For information about valid keys for this operation, see Understanding key
// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html)
// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html)
// in the Amazon Web Services Payment Cryptography User Guide.
//
// Cross-account use: This operation can't be used across different Amazon Web
// Services accounts.
//
// Related operations:
//
// - VerifyCardValidationData
//
// - VerifyPinData
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Payment Cryptography Data Plane's
// API operation VerifyAuthRequestCryptogram for usage and error information.
//
// Returned Error Types:
//
// - ValidationException
// The request was denied due to an invalid request error.
//
// - VerificationFailedException
// This request failed verification.
//
// - AccessDeniedException
// You do not have sufficient access to perform this action.
//
// - ResourceNotFoundException
// The request was denied due to an invalid resource error.
//
// - ThrottlingException
// The request was denied due to request throttling.
//
// - InternalServerException
// The request processing has failed because of an unknown error, exception,
// or failure.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram
func (c *PaymentCryptographyData) VerifyAuthRequestCryptogram(input *VerifyAuthRequestCryptogramInput) (*VerifyAuthRequestCryptogramOutput, error) {
req, out := c.VerifyAuthRequestCryptogramRequest(input)
return out, req.Send()
}
// VerifyAuthRequestCryptogramWithContext is the same as VerifyAuthRequestCryptogram with the addition of
// the ability to pass a context and additional request options.
//
// See VerifyAuthRequestCryptogram for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create