use of software.amazon.awssdk.services.iam.model.GetServerCertificateResponse 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);
}
}
Aggregations