選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

續約憑證

焦點模式
續約憑證 - AWS Certificate Manager

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

以下範例說明如何使用 RenewCertificate 函數。此函數會續約由私有憑證授權機構 (CA) 發行並使用 ExportCertificate 函數匯出的私有憑證。目前,此函數只能續約匯出的私有憑證。若要使用 ACM 續約您的 AWS 私有 CA 憑證,您必須先授予 ACM 服務主體許可才能執行此操作。如需詳細資訊,請參閱指派憑證續約許可給 ACM

package com.amazonaws.samples; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.services.certificatemanager.AWSCertificateManagerClientBuilder; import com.amazonaws.services.certificatemanager.AWSCertificateManager; import com.amazonaws.services.certificatemanager.model.RenewCertificateRequest; import com.amazonaws.services.certificatemanager.model.RenewCertificateResult; import com.amazonaws.services.certificatemanager.model.InvalidArnException; import com.amazonaws.services.certificatemanager.model.ResourceNotFoundException; import com.amazonaws.services.certificatemanager.model.ValidationException; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; public class RenewCertificate { 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 in Linux. AWSCredentials credentials = null; try { credentials = new ProfileCredentialsProvider().getCredentials(); } catch (Exception ex) { throw new AmazonClientException("Cannot load your credentials from file.", ex); } // Create a client. AWSCertificateManager client = AWSCertificateManagerClientBuilder.standard() .withRegion(Regions.your_region) .withCredentials(new AWSStaticCredentialsProvider(credentials)) .build(); // Create a request object and specify the ARN of the certificate to renew. RenewCertificateRequest req = new RenewCertificateRequest(); req.withCertificateArn("arn:aws:acm:region:account:" +"certificate/M12345678-1234-1234-1234-123456789012"); // Renew the certificate. RenewCertificateResult result = null; try { result = client.renewCertificate(req); } catch(InvalidArnException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } catch (ValidationException ex) { throw ex; } // Display the result. System.out.println(result); } }
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。