Java 类com.amazonaws.services.identitymanagement.model.GetServerCertificateRequest 实例源码

项目:aws-doc-sdk-examples    文件:GetServerCertificate.java   
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());
    }
项目:cerberus-lifecycle-cli    文件:IdentityManagementService.java   
/**
 * Checks if the server certificate is present.
 *
 * @param name The server certificate name
 * @return If present
 */
public boolean isServerCertificatePresent(final String name) {
    try {
        client.getServerCertificate(new GetServerCertificateRequest().withServerCertificateName(name));
        return true;
    } catch (final NoSuchEntityException nsee) {
        return false;
    }
}
项目:cerberus-lifecycle-cli    文件:IdentityManagementService.java   
/**
 * Gets the ARN for the specified server certificate name.
 *
 * @param name The server certificate name
 * @return ARN
 */
public Optional<String> getServerCertificateArn(final String name) {
    try {
        final GetServerCertificateResult serverCertificateResult =
                client.getServerCertificate(new GetServerCertificateRequest().withServerCertificateName(name));
        return Optional.of(serverCertificateResult.getServerCertificate().getServerCertificateMetadata().getArn());
    } catch (final NoSuchEntityException nsee) {
        return Optional.empty();
    }
}
项目:cerberus-lifecycle-cli    文件:IdentityManagementService.java   
/**
 * Gets the ID for the specified server certificate name.
 *
 * @param name The server certificate name
 * @return ID
 */
public Optional<String> getServerCertificateId(final String name) {
    try {
        final GetServerCertificateResult serverCertificateResult =
                client.getServerCertificate(new GetServerCertificateRequest().withServerCertificateName(name));
        return Optional.of(serverCertificateResult.getServerCertificate()
                .getServerCertificateMetadata().getServerCertificateId());
    } catch (final NoSuchEntityException nsee) {
        return Optional.empty();
    }
}
项目:cmn-project    文件:IAM.java   
public ServerCertificate getServerCert(String serverCertName) {
    logger.info("get server cert, name={}", serverCertName);
    return iam.getServerCertificate(new GetServerCertificateRequest(serverCertName)).getServerCertificate();
}