File tree 1 file changed +13
-11
lines changed
src/aws_encryption_sdk/materials_managers/mpl
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -78,18 +78,20 @@ def get_encryption_materials(
78
78
def _native_to_mpl_get_encryption_materials (
79
79
request : EncryptionMaterialsRequest
80
80
) -> 'MPL_GetEncryptionMaterialsInput' :
81
- commitment_policy = CryptoMaterialsManagerFromMPL ._native_to_mpl_commitment_policy (
82
- request .commitment_policy
83
- )
84
- output : MPL_GetEncryptionMaterialsInput = MPL_GetEncryptionMaterialsInput (
85
- encryption_context = request .encryption_context ,
86
- commitment_policy = commitment_policy ,
87
- algorithm_suite_id = CryptoMaterialsManagerFromMPL ._native_algorithm_id_to_mpl_algorithm_id (
81
+ output_kwargs = {
82
+ "encryption_context" : request .encryption_context ,
83
+ "max_plaintext_length" : request .plaintext_length ,
84
+ "commitment_policy" : CryptoMaterialsManagerFromMPL ._native_to_mpl_commitment_policy (
85
+ request .commitment_policy
86
+ )
87
+ }
88
+
89
+ if request .algorithm is not None :
90
+ output_kwargs ["algorithm_suite_id" ] = CryptoMaterialsManagerFromMPL ._native_algorithm_id_to_mpl_algorithm_id (
88
91
request .algorithm .algorithm_id
89
- ),
90
- max_plaintext_length = request .plaintext_length ,
91
- )
92
- return output
92
+ )
93
+
94
+ return MPL_GetEncryptionMaterialsInput (** output_kwargs )
93
95
94
96
@staticmethod
95
97
def _native_to_mpl_commitment_policy (
You can’t perform that action at this time.
0 commit comments