Uploads an X.509 signing certificate and associates it with the specified user. Some AWS
services use X.509 signing certificates to validate requests that are signed with a
corresponding private key. When you upload the certificate, its default status is
Active
.
If the UserName
field is not specified, the user name is determined implicitly
based on the AWS Access Key ID used to sign the request. Because this action works for access
keys under the AWS account, this API can be used to manage root credentials even if the AWS
account has no associated users.
Because the body of a 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, go to Signing AWS API Requests in the AWS General Reference. For general
information about using the Query API with IAM, go to Making Query Requests in Using IAM.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The contents of the signing certificate. [Constraints: The value must be between 1 and 16384 characters, and must match the following regular expression pattern: |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Upload an X.509 signing certificate.
$x509_certificate = <<<CERT -----BEGIN EXAMPLE CERTIFICATE----- EXAMPLECAeGgAwIBAgIGAIBHCmYxMA0GCSqGSIb3DQEBBQUAMFMxCzAJBgNVBAYT AlVTMRMEXAMPLEQKEwpBbWF6b24uY29tMQwwCgYDVQQLEwNBV1MxITAfBgNVBAMT GEFXUyBMaW1pdGEXAMPLE3VyYW5jZSBDQTAeFw0xMDA5MDEwMzE0NDRaFw0xMTA5 MDEwMzE0NDRaMFMxCzAJBEXAMPLEAlVTMRMwEQYDVQQKEwpBbWF6b24uY29tMRcw FQYDVQQLEw5BV1MtRGV2ZWxvcGVyEXAMPLEGA1UEAxMNMTM1ZDUzaHpjOWppajCB nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEEXAMPLEkQAQQQJYx1ZSo2hHkruELw l8xQVIMwWkyL4COOKAKFPjnM8AbpXT98DcwnvMTPodEXAMPLERBwZUlXhvsXCIZ/ PyBC18ef7suZbITHhSCOyqiR0iZOyTsK7h9xF5pGptgrCGrMIEXAMPLEGOb7Tl+5 P6hE+TGzD/c9aK8CAwEAAaNXMFUwDgYDVR0PAQH/BAQDAgWgMBYGA1UdEXAMPLEM EXAMPLEGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFLxafWX3qRESqFU1 4/A4QW+EXAMPLE0GCSqGSIb3DQEBBQUAA4GBADCWnRMuwpCzlHtAOQTAszq6LPBB UDVslkapUlDKjQEXAMPLE1A3+PCmZXWVW0zkmzZn1komB4/3GofnKWxjot5y+dnU tPdpG8PdAOPTTYqLEOnIqEXAMPLEsvswV5CbNPIZzsAmOVtw1D3u+qUAW8yXidH6 jl5XFaJpamQ0vpIy -----END EXAMPLE CERTIFICATE----- CERT; // Instantiate the class $iam = new AmazonIAM(); $response = $iam->upload_signing_certificate($x509_certificate, array( 'UserName' => 'johndoe2' )); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/iam.class.php | Toggle source view (7 lines) | View on GitHub