Search in sources :

Example 1 with GetServerCertificateRequest

use of software.amazon.awssdk.services.iam.model.GetServerCertificateRequest in project aws-doc-sdk-examples by awsdocs.

the class GetServerCertificate method getCertificate.

// snippet-start:[iam.java2.get_server_certificate.main]
public static void getCertificate(IamClient iam, String certName) {
    try {
        GetServerCertificateRequest request = GetServerCertificateRequest.builder().serverCertificateName(certName).build();
        GetServerCertificateResponse response = iam.getServerCertificate(request);
        System.out.format("Successfully retrieved certificate with body %s", response.serverCertificate().certificateBody());
    } catch (IamException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : GetServerCertificateResponse(software.amazon.awssdk.services.iam.model.GetServerCertificateResponse) GetServerCertificateRequest(software.amazon.awssdk.services.iam.model.GetServerCertificateRequest) IamException(software.amazon.awssdk.services.iam.model.IamException)

Aggregations

GetServerCertificateRequest (software.amazon.awssdk.services.iam.model.GetServerCertificateRequest)1 GetServerCertificateResponse (software.amazon.awssdk.services.iam.model.GetServerCertificateResponse)1 IamException (software.amazon.awssdk.services.iam.model.IamException)1