use of com.amazonaws.services.identitymanagement.model.GetServerCertificateRequest in project aws-doc-sdk-examples by awsdocs.
the class GetServerCertificate method main.
public static void main(String[] args) {
final String USAGE = "To run this example, supply a certificate name\n" + "Ex: GetServerCertificate <certificate-name>\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String cert_name = args[0];
final AmazonIdentityManagement iam = AmazonIdentityManagementClientBuilder.defaultClient();
GetServerCertificateRequest request = new GetServerCertificateRequest().withServerCertificateName(cert_name);
GetServerCertificateResult response = iam.getServerCertificate(request);
System.out.format("Successfully retrieved certificate with body %s", response.getServerCertificate().getCertificateBody());
}
Aggregations