Skip to content

/AWS1/IF_IAM=>UPLOADSIGNINGCERTIFICATE()

About UploadSigningCertificate

Uploads an X.509 signing certificate and associates it with the specified IAM user. Some Amazon Web Services services require you to use certificates to validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is Active.

For information about when you would use an X.509 signing certificate, see Managing server certificates in IAM in the IAM User Guide.

If the UserName is not specified, the IAM user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the Amazon Web Services account. Consequently, you can use this operation to manage Amazon Web Services account root user credentials even if the Amazon Web Services account has no associated users.

Because the body of an X.509 certificate can be large, you should use POST rather than GET when calling UploadSigningCertificate. For information about setting up signatures and authorization through the API, see Signing Amazon Web Services API requests in the Amazon Web Services General Reference. For general information about using the Query API with IAM, see Making query requests in the IAM User Guide.

Method Signature

METHODS /AWS1/IF_IAM~UPLOADSIGNINGCERTIFICATE
  IMPORTING
    !IV_USERNAME TYPE /AWS1/IAMEXISTINGUSERNAMETYPE OPTIONAL
    !IV_CERTIFICATEBODY TYPE /AWS1/IAMCERTIFICATEBODYTYPE OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_iamuploadsigningcrt01
  RAISING
    /AWS1/CX_IAMCONCURRENTMODEX
    /AWS1/CX_IAMDUPLICATECERTEX
    /AWS1/CX_IAMENTITYALRDYEXEX
    /AWS1/CX_IAMINVALIDCERTEX
    /AWS1/CX_IAMLIMITEXCEEDEDEX
    /AWS1/CX_IAMMALFORMEDCERTEX
    /AWS1/CX_IAMNOSUCHENTITYEX
    /AWS1/CX_IAMSERVICEFAILUREEX
    /AWS1/CX_IAMCLIENTEXC
    /AWS1/CX_IAMSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_certificatebody TYPE /AWS1/IAMCERTIFICATEBODYTYPE /AWS1/IAMCERTIFICATEBODYTYPE

The contents of the signing certificate.

The regex pattern used to validate this parameter is a string of characters consisting of the following:

  • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range

  • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)

  • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

Optional arguments:

iv_username TYPE /AWS1/IAMEXISTINGUSERNAMETYPE /AWS1/IAMEXISTINGUSERNAMETYPE

The name of the user the signing certificate is for.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

RETURNING

oo_output TYPE REF TO /aws1/cl_iamuploadsigningcrt01 /AWS1/CL_IAMUPLOADSIGNINGCRT01

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->uploadsigningcertificate(
  iv_certificatebody = |string|
  iv_username = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_signingcertificate = lo_result->get_certificate( ).
  IF lo_signingcertificate IS NOT INITIAL.
    lv_usernametype = lo_signingcertificate->get_username( ).
    lv_certificateidtype = lo_signingcertificate->get_certificateid( ).
    lv_certificatebodytype = lo_signingcertificate->get_certificatebody( ).
    lv_statustype = lo_signingcertificate->get_status( ).
    lv_datetype = lo_signingcertificate->get_uploaddate( ).
  ENDIF.
ENDIF.

To upload a signing certificate for an IAM user

The following command uploads a signing certificate for the IAM user named Bob.

DATA(lo_result) = lo_client->uploadsigningcertificate(
  iv_certificatebody = |-----BEGIN CERTIFICATE-----<certificate-body>-----END CERTIFICATE-----|
  iv_username = |Bob|
).