AWS code-library documentation change
Summary
Added SAP ABAP SDK code example for ImportCertificate API with conditional chain handling
Security assessment
While certificate import is security-sensitive, this change only adds a standard implementation example. The error handling for invalid parameters doesn't address specific vulnerabilities. No security best practices or warnings are added.
Diff
diff --git a/code-library/latest/ug/acm_example_acm_ImportCertificate_section.md b/code-library/latest/ug/acm_example_acm_ImportCertificate_section.md index a7c02c779..fd5c17a3c 100644 --- a//code-library/latest/ug/acm_example_acm_ImportCertificate_section.md +++ b//code-library/latest/ug/acm_example_acm_ImportCertificate_section.md @@ -292,0 +293,40 @@ There's more on GitHub. Find the complete example and learn how to set up and ru +SAP ABAP + + +**SDK for SAP ABAP** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/acm#code-examples). + + + TRY. + " Only pass certificate chain if it's provided (it's optional) + IF iv_certificate_chain IS NOT INITIAL. + DATA(lo_result) = lo_acm->importcertificate( + iv_certificate = iv_certificate + iv_privatekey = iv_private_key + iv_certificatechain = iv_certificate_chain + ). + ELSE. + lo_result = lo_acm->importcertificate( + iv_certificate = iv_certificate + iv_privatekey = iv_private_key + ). + ENDIF. + ov_certificate_arn = lo_result->get_certificatearn( ). + MESSAGE 'Certificate imported successfully.' TYPE 'I'. + CATCH /aws1/cx_acminvalidparameterex. + MESSAGE 'Invalid parameter provided.' TYPE 'I'. + CATCH /aws1/cx_acmlimitexceededex. + MESSAGE 'Certificate limit exceeded.' TYPE 'I'. + ENDTRY. + + + + * For API details, see [ImportCertificate](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + +