re_encrypt_data
async
¶
re_encrypt_data(
incoming_key_identifier: KeyArnOrKeyAliasType,
outgoing_key_identifier: KeyArnOrKeyAliasType,
cipher_text: CipherTextType,
incoming_encryption_attributes: ReEncryptionAttributes,
outgoing_encryption_attributes: ReEncryptionAttributes,
*,
config_overrides: Optional[AsyncPaymentCryptographyDataClientConfig] = None,
incoming_wrapped_key: Optional[WrappedKey] = None,
outgoing_wrapped_key: Optional[WrappedKey] = None,
) -> ReEncryptDataOutput
Re-encrypts ciphertext using DUKPT, symmetric, or asymmetric data encryption keys.
You can either generate an encryption key within Amazon Web Services Payment Cryptography by calling CreateKey or import your own encryption key by calling ImportKey. The KeyArn for use with this operation must be in a compatible key state with KeyModesOfUse set to Encrypt.
This operation also supports dynamic keys, allowing you to pass a dynamic encryption key as a TR-31 WrappedKeyBlock. This can be used when key material is frequently rotated, such as during every card transaction, and there is need to avoid importing short-lived keys into Amazon Web Services Payment Cryptography. To re-encrypt using dynamic keys, the keyARN is the Key Encryption Key (KEK) of the TR-31 wrapped encryption key material. The incoming wrapped key shall have a key purpose of D0 with a mode of use of B or D. For more information, see Using Dynamic Keys in the Amazon Web Services Payment Cryptography User Guide.
Amazon Web Services Payment Cryptography supports the following encryption key schemes:
-
DUKPT:
TDESandAESalgorithms. To encrypt using DUKPT, a DUKPT key must already exist within your account withKeyModesOfUseset toDeriveKeyor a new DUKPT can be generated by calling CreateKey. -
Symmetric:
TDESandAESalgorithms. -
Asymmetric:
RSA. You can use anRSAkey on either the incoming or the outgoing side, paired with a symmetric key on the other side.
For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.
Cross-account use: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see Resource-based policies.
Related operations:
Parameters:
-
incoming_key_identifier(KeyArnOrKeyAliasType) –The
keyARNof the encryption key of incoming ciphertext data.When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.
-
outgoing_key_identifier(KeyArnOrKeyAliasType) –The
keyARNof the encryption key of outgoing ciphertext data after encryption by Amazon Web Services Payment Cryptography. -
cipher_text(CipherTextType) –Ciphertext to be encrypted. The minimum allowed length is 16 bytes and maximum allowed length is 4096 bytes.
-
incoming_encryption_attributes(ReEncryptionAttributes) –The attributes and values for incoming ciphertext.
-
outgoing_encryption_attributes(ReEncryptionAttributes) –The attributes and values for outgoing ciphertext data after encryption by Amazon Web Services Payment Cryptography.
-
incoming_wrapped_key(Optional[WrappedKey], default:None) –The WrappedKeyBlock containing the encryption key of incoming ciphertext data.
-
outgoing_wrapped_key(Optional[WrappedKey], default:None) –The WrappedKeyBlock containing the encryption key of outgoing ciphertext data after encryption by Amazon Web Services Payment Cryptography.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–The request processing has failed because of an unknown error, exception, or failure.
-
ResourceNotFoundException–The request was denied due to an invalid resource error.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The request was denied due to an invalid request error.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_payment_cryptography_data/_services/async_payment_cryptography_data.py
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 | |