DeleteCertificateAuthority - AWS Private Certificate Authority

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

DeleteCertificateAuthority

次の Java サンプルは、 DeleteCertificateAuthorityオペレーションの使用方法を示しています。

このオペレーションは、 CreateCertificateAuthorityオペレーションを使用して作成したプライベート認証機関 (CA) を削除します。DeleteCertificateAuthority オペレーションでは、削除する CA の ARN を指定する必要があります。ARN は、 ListCertificateAuthoritiesオペレーションを呼び出すことで確認できます。プライベート CA のステータスが CREATING または PENDING_CERTIFICATE である場合は、即座に削除できます。ただし、証明書を既にインポートしている場合は、すぐに削除することはできません。まず、 UpdateCertificateAuthorityオペレーションを呼び出して CA を無効にし、 Statusパラメータを に設定する必要がありますDISABLED。その後、DeleteCertificateAuthority オペレーションで PermanentDeletionTimeInDays パラメータを使用して、7~30 の日数を指定できます。その期間中、プライベート CA は disabled ステータスに復元できます。デフォルトでは、PermanentDeletionTimeInDays パラメータを設定しない場合、復元期間は 30 日です。この期間が経過すると、プライベート CA は完全に削除され、復元できなくなります。詳細については、「CA の復元」を参照してください。

RestoreCertificateAuthority オペレーションの使用方法を示す Java の例については、「」を参照してくださいRestoreCertificateAuthority

package com.amazonaws.samples; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.client.builder.AwsClientBuilder; import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.services.acmpca.AWSACMPCA; import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder; import com.amazonaws.services.acmpca.model.DeleteCertificateAuthorityRequest; import com.amazonaws.AmazonClientException; import com.amazonaws.services.acmpca.model.ResourceNotFoundException; import com.amazonaws.services.acmpca.model.InvalidArnException; import com.amazonaws.services.acmpca.model.InvalidStateException; import com.amazonaws.services.acmpca.model.RequestFailedException; public class DeleteCertificateAuthority { public static void main(String[] args) throws Exception{ // Retrieve your credentials from the C:\Users\name\.aws\credentials file // in Windows or the .aws/credentials file in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider("default").getCredentials(); } catch (Exception e) { throw new AmazonClientException("Cannot load your credentials from disk", e); } // Define the endpoint for your sample. String endpointRegion = "region"; // Substitute your region here, e.g. "us-west-2" String endpointProtocol = "https://acm-pca." + endpointRegion + ".amazonaws.com/"; EndpointConfiguration endpoint = new AwsClientBuilder.EndpointConfiguration(endpointProtocol, endpointRegion); // Create a client that you can use to make requests. AWSACMPCA client = AWSACMPCAClientBuilder.standard() .withEndpointConfiguration(endpoint) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a requrest object and set the ARN of the private CA to delete. DeleteCertificateAuthorityRequest req = new DeleteCertificateAuthorityRequest(); // Set the certificate authority ARN. req.withCertificateAuthorityArn("arn:aws:acm-pca:us-east-1:111122223333:certificate-authority/11223344-1234-1122-2233-112233445566"); // Set the recovery period. req.withPermanentDeletionTimeInDays(12); // Delete the CA. try { client.deleteCertificateAuthority(req); } catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } catch (InvalidStateException ex) { throw ex; } catch (RequestFailedException ex) { throw ex; } } }