UploadServerCertificate#

Description#

Imports a server certificate to IAM.

Note

When calling UploadServerCertificate, use POST HTTP request in the application/x-www-form-urlencoded format, as the certificate public key, private key, and certificate chain might exceed the permissible URI length.

Request Parameters#

Required parameters#

  • CertificateBody — The server certificate public key (PEM-encoded).

    • Type: String

    • Required: Yes

  • PrivateKey — The server certificate private key (PEM-encoded).

    • Type: String

    • Required: Yes

  • ServerCertificateName — The name of the server certificate.

    • Type: String

    • Required: Yes

Optional parameters#

  • CertificateChain — The server certificate chain (PEM-encoded).

    • Type: String

    • Required: No

Response Elements#

  • ServerCertificateMetadata — Information about the imported server certificate.

Examples#

Request

POST https://iam.k2.cloud/
Content-type: x-www-form-urlencoded

?Action=UploadServerCertificate
&CertificateBody=
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
&CertificateChain=
-----BEGIN CERTIFICATE-----
MIICdzCCAeCgAwIBAgIGANc+Ha2wMA0GCSqGSIb3DQEBBQUAMFMxCzAJBgNVBAYT
...
AEaHzTpmEXAMPLE=
-----END CERTIFICATE-----
&PrivateKey=
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDcZBGcSeGzAhHE
...
DqNYMB1T0XX1Y5L7IMDuEKlj
-----END PRIVATE KEY-----
&ServerCertificateName=certificate-1

Response

<UploadServerCertificateResponse>
    <UploadServerCertificateResult>
        <ServerCertificateMetadata>
            <ServerCertificateName>certificate-1</ServerCertificateName>
            <ServerCertificateId>b459eb43-b876-49f7-8bf5-7fcd6680a0af</ServerCertificateId>
            <Arn>arn:c2:iam::c2dev:server-certificate/certificate-1</Arn>
            <UploadDate>1725442777</UploadDate>
            <Expiration>1750709690</Expiration>
        </ServerCertificateMetadata>
    </UploadServerCertificateResult>
    <requestId>a4ada9f2-a029-461c-8f49-185d3cd640bd</requestId>
    <ResponseMetadata>
        <RequestId>a4ada9f2-a029-461c-8f49-185d3cd640bd</RequestId>
    </ResponseMetadata>
</UploadServerCertificateResponse>
c2-iam UploadServerCertificate ServerCertificateName certificate-1 CertificateBody <certificate-body> PrivateKey <private-key>

c2-iam UploadServerCertificate ServerCertificateName certificate-1 CertificateBody <certificate-body> CertificateChain <certificate-chain> PrivateKey <private-key>