Search in sources :

Example 1 with GetServerCertificateResult

use of com.amazonaws.services.identitymanagement.model.GetServerCertificateResult 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());
}
Also used : GetServerCertificateRequest(com.amazonaws.services.identitymanagement.model.GetServerCertificateRequest) AmazonIdentityManagement(com.amazonaws.services.identitymanagement.AmazonIdentityManagement) GetServerCertificateResult(com.amazonaws.services.identitymanagement.model.GetServerCertificateResult)

Aggregations

AmazonIdentityManagement (com.amazonaws.services.identitymanagement.AmazonIdentityManagement)1 GetServerCertificateRequest (com.amazonaws.services.identitymanagement.model.GetServerCertificateRequest)1 GetServerCertificateResult (com.amazonaws.services.identitymanagement.model.GetServerCertificateResult)1