id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
a07f5acf1c4e-0
The following CloudTrail example shows the results of a call to the [GetCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificate.html) operation\. ``` { "eventVersion":"1.05", "userIdentity":{ "type":"IAMUser", "principalId":"account", "arn":"arn:aws:iam::account:user/name", "accountId":"account", "accessKeyId":"Key_ID" }, "eventTime":"2018-01-26T22:22:54Z", "eventSource":"acm-pca.amazonaws.com", "eventName":"GetCertificate", "awsRegion":"us-east-1", "sourceIPAddress":"xx.xx.xx.xx", "userAgent":"aws-cli/1.14.28 Python/2.7.9 Windows/8 botocore/1.8.32", "requestParameters":{
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-GetCertificate.md
a07f5acf1c4e-1
"requestParameters":{ "certificateAuthorityArn":"arn:aws:acm-pca:region:account:certificate-authority/ac5a7c2e-19c8-4258-b74e-351c2b791fe1", "certificateArn":"arn:aws:acm-pca:region:account:certificate-authority/ac5a7c2e-19c8-4258-b74e-351c2b791fe1/certificate/6707447683a9b7f4055627ffd55cebcc" }, "responseElements":null, "requestID":"ec0681a9-6202-496e-985a-adba939311e4", "eventID":"89be1a2a-3340-4d74-a633-5582a2fba1d3", "eventType":"AwsApiCall", "recipientAccountId":"account" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-GetCertificate.md
f5c2fcf81d74-0
AWS Certificate Manager Private Certificate Authority conforms to the AWS [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/), which includes regulations and guidelines for data protection\. AWS is responsible for protecting the global infrastructure that runs all the AWS services\. AWS maintains control over data hosted on this infrastructure, including the security configuration controls for handling customer content and personal data\. AWS customers and APN Partners, acting either as data controllers or data processors, are responsible for any personal data that they put in the AWS Cloud\. For data protection purposes, we recommend that you protect AWS account credentials and set up individual user accounts and to control access to ACM Private CA API operations with [AWS Identity and Access Management \(IAM\)](security-iam.md)\. Doing so ensures that each user is given only the permissions necessary to fulfill their job duties\. We also recommend that you secure your data in the following ways: + Use multi\-factor authentication \(MFA\) with each account\. + Use SSL/TLS to communicate with AWS resources\. + Set up API and user activity logging with [AWS CloudTrail](PcaCtIntro.md)\. + Use AWS encryption solutions, along with all default security controls within AWS services\. + Use advanced managed security services such as [Amazon Macie](https://docs.aws.amazon.com/macie/latest/userguide/), which assists in discovering and securing personal data that is stored in Amazon S3\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/data-protection.md
f5c2fcf81d74-1
We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free\-form fields such as a **Name** field\. This includes when you work with ACM Private CA or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into ACM Private CA or other services might get picked up for inclusion in diagnostic logs\. When you provide a URL to an external server, don't include credentials information in the URL to validate your request to that server\. For more information about data protection, see the [AWS Shared Responsibility Model and GDPR](http://aws.amazon.com/blogs/security/the-aws-shared-responsibility-model-and-gdpr/) blog post on the *AWS Security Blog*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/data-protection.md
90fc93d8f958-0
The private keys for your private CAs are stored in AWS managed hardware security modules \(HSMs\)\. These adhere to [FIPS 140\-2 Level 3 security standards](https://csrc.nist.gov/projects/cryptographic-module-validation-program/standards)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/data-protection.md
adea565821fe-0
Both ACM Private CA and the IAM principal must have permission to write to the Amazon S3 bucket that you specify for your CRLs\. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown\. To provide notice of this, configure an alarm for the `MisconfiguredCRLBucket` metric in Amazon CloudWatch\. For more information, see [Configure Access to ACM Private CA](https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html) and [Supported CloudWatch Metrics](https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaCloudWatch.html)\. If you encounter this exception, check that you have not selected the **Block public access to buckets and objects granted through new access control lists \(ACLs\)** configuration option in your Amazon S3 account\. For more information, see [How Do I Edit Public Access Settings for S3 Buckets?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/block-public-access-bucket.html)\. CRLs may also fail to update as expected if you have inadvertently changed S3 permissions since the CRL was created\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCA-TA-S3.md
e5afc831b9f6-0
With a private CA in place, you can request private end\-entity certificates from either AWS Certificate Manager \(ACM\) or ACM Private CA\. The capabilities of both services are compared in the following table\. **** | Capability | ACM | ACM Private CA | | --- | --- | --- | | Issue end\-entity certificates | βœ“ \(using [RequestCertificate](https://docs.aws.amazon.com/acm/latest/APIReference/API_RequestCertificate.html) \+ [GetCertificate](https://docs.aws.amazon.com/acm/latest/APIReference/API_GetCertificate.html) or the console\) | βœ“ \(using [IssueCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html)\) | | Association with internet\-facing AWS services | βœ“ | Not supported | | Console support | βœ“ | Not supported | | API support | βœ“ | βœ“ | | CLI support | βœ“ | βœ“ |
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaIssueCert.md
e5afc831b9f6-1
| Console support | βœ“ | Not supported | | API support | βœ“ | βœ“ | | CLI support | βœ“ | βœ“ | When ACM Private CA creates a certificate, it follows a template that specifies the certificate type and path length\. If no template ARN is supplied to the API or CLI statement creating the certificate, the [EndEntityCertificate/V1](UsingTemplates.md#EndEntityCertificate-V1) template is applied by default\. For more information about available certificate templates, see [Understanding Certificate Templates](UsingTemplates.md)\. While ACM certificates are designed around public trust, ACM Private CA serves the needs of your private PKI\. Consequently, you can configure certificates using the ACM Private CA API and CLI in ways not permitted by ACM\. These include the following: + Creating a certificate with any subject name\. + Using any of the [supported private key algorithms and key lengths](https://docs.aws.amazon.com/acm-pca/latest/userguide/supported-algorithms.html)\. + Using any of the [supported signing algorithms](https://docs.aws.amazon.com/acm-pca/latest/userguide/supported-algorithms.html)\. + Specifying any validity period for your private [CA](PcaCreateCa.html) and private [certificates](PcaIssueCert.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaIssueCert.md
e5afc831b9f6-2
+ Specifying any validity period for your private [CA](PcaCreateCa.html) and private [certificates](PcaIssueCert.html)\. After creating a private certificate using ACM Private CA, you can [import](https://docs.aws.amazon.com/acm/latest/userguide/import-certificate-api-cli.html) it into ACM and use it with a supported AWS service\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaIssueCert.md
2b06047a5cde-0
You can use the ACM Private CA CLI command [issue\-certificate](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/issue-certificate.html) or the API action [IssueCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html) to request an end\-entity certificate\. This command requires the Amazon Resource Name \(ARN\) of the private CA that you want to use to issue the certificate\. If you use the ACM Private CA API or AWS CLI to issue a private certificate, the certificate in unmanaged, meaning that you cannot use the ACM console, ACM CLI, or ACM API to view or export it, and the certificate is not automatically renewed\. However, you can use the PCA [get\-certificate](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/get-certificate.html) command to retrieve the certificate details, and if you own the CA, you can create an [audit report](PcaAuditReport.md)\. The following command specifies no template, so an end\-entity certificate is issued by default\. ``` aws acm-pca issue-certificate \ --certificate-authority-arn arn:aws:acm-pca:region:account:\ certificate-authority/12345678-1234-1234-1234-123456789012 \
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaIssueCert.md
2b06047a5cde-1
certificate-authority/12345678-1234-1234-1234-123456789012 \ --csr fileb://C:\cert_1.csr \ --signing-algorithm "SHA256WITHRSA" \ --validity Value=365,Type="DAYS" \ --idempotency-token 1234 ``` The ARN of the issued certificate is returned: ``` { "CertificateArn": "arn:aws:acm-pca:region:account:\ certificate-authority/12345678-1234-1234-1234-123456789012/certificate/a2b95975ec6e1cd85a21c2104c5be129" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaIssueCert.md
4e6a11823898-0
After you have created and activated a private certificate authority \(CA\) and configured access to it, you or your authorized users can perform the tasks discussed in this section\. If you have not yet set up AWS Identity and Access Management \(IAM\) policies for the CA, you can learn more about configuring them in the [Identity and Access Management](https://docs.aws.amazon.com/acm-pca/latest/userguide/security-iam.html) section of this guide\. For information about configuring CA access in single\-account and cross\-account scenarios, see [Enabling Access to a Private CA](granting-ca-access.md)\. **Topics** + [Issuing a Private End\-Entity Certificate](PcaIssueCert.md) + [Revoking a Private Certificate](PcaRevokeCert.md) + [Understanding Certificate Templates](UsingTemplates.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaUsing.md
8c5d50b0a66c-0
The following Java sample shows how to use the [GetPolicy](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetPolicy.html) operation\. The operation retrieves the resource\-based policy attached to a private CA\. A resource\-based policy is used to enable cross\-account CA sharing\. You can find the ARN of a private CA by calling the [ListCertificateAuthorities](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html) action\. Related API actions include [PutPolicy](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_PutPolicy.html) and [DeletePolicy](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePolicy.html)\. ``` 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;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetPolicy.md
8c5d50b0a66c-1
import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.services.acmpca.AWSACMPCA; import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder; import com.amazonaws.AmazonClientException; import com.amazonaws.services.acmpca.model.GetPolicyRequest; import com.amazonaws.services.acmpca.model.GetPolicyResult; import com.amazonaws.services.acmpca.model.AWSACMPCAException; import com.amazonaws.services.acmpca.model.InvalidArnException; import com.amazonaws.services.acmpca.model.InvalidStateException; import com.amazonaws.services.acmpca.model.RequestFailedException; import com.amazonaws.services.acmpca.model.ResourceNotFoundException; public class GetPolicy { 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) {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetPolicy.md
8c5d50b0a66c-2
credentials = new ProfileCredentialsProvider("default").getCredentials(); } catch (Exception e) { throw new AmazonClientException("Cannot load your credentials from file.", 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 the request object. GetPolicyRequest req = new GetPolicyRequest(); // Set the resource ARN. req.withResourceArn("arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012");
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetPolicy.md
8c5d50b0a66c-3
// Retrieve a list of your CAs. GetPolicyResult result= null; try { result = client.getPolicy(req); } catch (InvalidArnException ex) { throw ex; } catch (InvalidStateException ex) { throw ex; } catch (RequestFailedException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } catch (AWSACMPCAException ex) { throw ex; } // Display the policy. System.out.println(result.getPolicy()); } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-GetPolicy.md
490bdb643441-0
Name constraints are defined in the internet public key infrastructure \(PKI\) standard RFC 5280\. These constraints provide a way for CA administrators to restrict subject names in certificates\. Administrators can control which names are allowed or prohibited in certificates that are issued from their private CAs\. For example, a private domain name such as "project1\.corp" might be allowed\. But another private domain name such as "project2\.corp" might be reserved for a different internal project\. Similarly, public DNS names such as "example\.com" or "\*\.com" can be denied\. For more information, see the [Name Constraints](https://tools.ietf.org/html/rfc5280#section-4.2.1.10) section of RFC 5280\. ACM Private CA enforces name constraints that are included in CA certificates\. However, CA certificates issued *by* ACM Private CA cannot include name constraints\. To apply name constraints in your private CA hierarchy, sign your AWS managed CA certificate with an external CA that supports issuing CA certificates with name constraints\. Then import that certificate into ACM Private CA\. Name constraints will now be inherited by certificates that your private CA issues\. **Note** Procedures for creating or obtaining an external CA are outside the scope of this guide\. Name constraints define names that can be either permitted or excluded in downstream certificate subtrees\. Applying name constraints prevents subordinate CA administrators from issuing certificates for domains or hosts outside of an authorized scope\. ACM Private CA supports name constraints for the following name forms: + `IPAddress` + `DirectoryName` + `UniformResourceIdentifier`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/name_constraints.md
490bdb643441-1
+ `IPAddress` + `DirectoryName` + `UniformResourceIdentifier` + `EmailAddress` + `DNSName` ACM Private CA will not import a certificate that is configured to enforce name constraints for one of the following unsupported name forms: + `OtherName` + `X400Address` + `RegisteredID` + `EDIPartyName`
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/name_constraints.md
9c3bbff3f006-0
Each of the following examples includes a stub certificate policy that defines a set of name constraints\. The examples also include an explanation of the resulting restrictions on certificate issuance\. The following general rules apply: + Name constraints are stated as *permitted* subtrees, *excluded* subtrees, or both\. + Permitted and excluded subtrees contain matching patterns, which may be empty\. If a `permitted` subtree is empty, then all names in that form are denied\. Similarly, if an `excluded` subtree is empty, then all names in that form are allowed\. + If a name form is not listed, then all names in that form are allowed\. + Placing a constraint on one name form has no effect on other name forms\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/name_constraints.md
256563e8bbcd-0
``` nameConstraints=critical,permitted; DNSName:.private DNSName:.local DNSName:.corp UniformResourceIdentifier: ``` **Result:** A DNS name is allowed only if it matches "\.private", "\.local", or "\.corp"\. Names in the `UniformResourceIdentifier` form are denied because there is no matching pattern\. All names in supported unlisted forms are allowed\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/name_constraints.md
dd51f9798024-0
``` nameConstraints=critical,excluded; DNSName:.example.com DNSName:.local ``` **Result:** A DNS name is denied if it matches "\.example\.com" or "\.local"\. All names in supported unlisted forms are allowed\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/name_constraints.md
33a018d5c94b-0
``` nameConstraints=critical,permitted; DNSName:.private DNSName:.local DNSName:.corp nameConstraints=critical,excluded; DNSName:.secret.corp DNSName:.example.com ``` **Result:** A DNS name matching "\.private" or "\.local" is allowed\. A DNS name matching "\.corp" is allowed unless it also matches "\.secret\.corp"\. A DNS name matching "\.example\.com" is denied\. All names in supported unlisted forms are allowed\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/name_constraints.md
47186ee12252-0
``` Root CA: nameConstraints=critical,permitted; DNSName:.private DNSName:.local DNSName:.corp Subordinate CA: nameConstraints=critical,permitted; DNSName:sub.private DNSName:a.b.local ``` **Result:** A DNS name is allowed if it matches "sub\.private" or "a\.b\.local"\. DNS names matching "\.corp" are denied\. All names in supported unlisted forms are allowed\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/name_constraints.md
7976e4f7f0cd-0
``` Root CA: nameConstraints=critical,excluded; DNSName:foo.private DNSName:foo.example Subordinate CA: nameConstraints=critical,excluded; DNSName:bar.private DNSName:.example IPAddress:0.0.0.0/0 ``` **Result:** A DNS name is allowed unless it matches "foo\.private", "bar\.private", or "\.example"\. Names in the `IPAddress` form are denied because the matching pattern matches all IP addresses\. All names in supported unlisted forms are allowed\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/name_constraints.md
f5b61225d3a5-0
After creating a private CA, you can update its status or its revocation configuration\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
77f10b551f61-0
The status of a CA managed by ACM Private CA results from a user action or, in some cases, from a service action, such as when a CA expires\. The status options available to CA administrators vary depending on the current status of the CA\. ACM Private CA can report the following status values: + **`CREATING`** – ACM Private CA is creating your private certificate authority\. + **`PENDING_CERTIFICATE`** – The CA has been created and now needs a certificate to be operational\. You must use your ACM Private CA\-hosted or on\-premises root or subordinate CA to sign your private CA CSR and then import it into ACM Private CA\. For more information, see [Creating and Installing the Certificate for a Private CA](PCACertInstall.md)\. + **`ACTIVE`** – Your private CA is active and can be used to sign and issue certificates\. + **`DISABLED`** – A disabled CA cannot issue new certificates\. While disabled, the CA supports revocation for certificates issued previously, and it continues to generate certificate revocation lists \(CRLs\)\. + **`EXPIRED`** – If the CA certificate for your private CA expires, ACM Private CA sets the status to `EXPIRED`\. Considerations: + CA certificates are not automatically renewed by default\. For information about automating renewal through AWS Certificate Manager, see [Assign Certificate Renewal Permissions to ACM](granting-ca-access.md#PcaPermissions)\. + An expired CA no longer generates CRLs\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
77f10b551f61-1
+ An expired CA no longer generates CRLs\. + Audit reports continue to work for an expired CA\. + Your account continues to be billed for an expired CA\. + You cannot directly change the status of an expired CA\. If you import a new certificate for the CA, its status returns to its state before it expired, either ACTIVE or DISABLED\. + If you import a new CA certificate for your private CA, ACM Private CA resets the status to `ACTIVE` unless you set it to `DISABLED` after the CA certificate expired\. + If you attempt to issue a new certificate with an expired CA, the `IssueCertificate` API returns `InvalidStateException`\. An expired root CA must self\-sign a new root CA certificate before it can issue new subordinate certificates\. + `The ListCertificate Authorities` and `DescribeCertificateAuthority` APIs return a status of `EXPIRED` if the CA certificate is expired, regardless of whether the CA status is set to `ACTIVE` or `DISABLED`\. However, if the expired CA has been set to `DELETED`, the status returned is `DELETED`\. + The `UpdateCertificateAuthority` API cannot update the status of an expired CA\. + The `RevokeCertificate` API can be used to revoke any expired certificate, including a CA certificate\. + **`FAILED`** – The `CreateCertificateAuthority` action failed\. This can occur because of a network outage, back\-end AWS failure, or other errors\. Considerations:
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
77f10b551f61-2
Considerations: + A failed CA cannot be recovered\. Delete the CA and create a new one\. + **`DELETED` **– Your private CA is within the restoration period\. which can have a length of seven to 30 days\. After this period, it is permanently deleted\. Considerations: + If you call the `RestoreCertificateAuthority` API on a CA with `DELETED` status and an expired certificate, the CA will be set to `EXPIRED`\. + For more information about deleting a CA, see [Deleting Your Private CA](PCADeleteCA.md)\. **Note** For all status values except DELETED and FAILED, you are billed for the CA\. The following diagram illustrates the CA lifecycle as an interaction of management actions with CA status\. ![\[Interaction of CA management actions and status.\]](http://docs.aws.amazon.com/acm-pca/latest/userguide/images/status.png) At the top of the diagram, management actions are applied through the ACM Private CA console, CLI, or API\. The actions take the CA through creation, activation, expiration and renewal\. The CA status changes in response \(as shown by the solid lines\) to manual actions or automated updates\. In most cases, a new status leads to a new possible action \(shown by a dotted line\) that the CA administrator can apply\. The lower\-right inset shows the possible status values permitting delete and restore actions\. **To update CA status using the AWS console**
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
77f10b551f61-3
**To update CA status using the AWS console** 1. Sign in to your AWS account and open the ACM Private CA console at [https://console\.aws\.amazon\.com/acm\-pca/home](https://console.aws.amazon.com/acm-pca/home)\. 1. Choose **Private CAs**\. 1. Choose your private CA from the list\. 1. On the **Actions** menu, choose **Disable** to disable a private CA that's currently active or choose **Enable** to set a CA active\. **To update your private CA status using the AWS CLI** Use the [update\-certificate\-authority](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/update-certificate-authority.html) command\. You can use a file similar to the following to specify the CRL configuration\. ``` { "CrlConfiguration": {"Enabled": true, "ExpirationInDays": 7, "CustomCname": "https://www.somename.crl", "S3BucketName": "your-crl-bucket-name"} } ``` The following command uses the preceding file to configure revocation and sets the status of the private CA to `ACTIVE`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
77f10b551f61-4
``` The following command uses the preceding file to configure revocation and sets the status of the private CA to `ACTIVE`\. ``` aws acm-pca update-certificate-authority \ --certificate-authority-arn arn:aws:acm-pca:region:account:\ certificate-authority/12345678-1234-1234-1234-1232456789012 \ --revocation-configuration file://C:\revoke_config.txt \ --status "ACTIVE" ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
ce87993b3bf5-0
You can update the Certificate Revocation List \(CRL\) configuration for your private CA to change any of the following values: + Whether the private CA generates a certificate revocation list \(CRL\) + The number of days before a CRL expires\. Note that ACM Private CA begins trying to regenerate the CRL at Β½ the number of days you specify\. + The name of the Amazon S3 bucket where your CRL is saved\. + An alias to hide the name of your S3 bucket from public view\. **Important** Changing any of the preceding parameters can have negative consequences\. For example, disabling CRL generation, changing the validity period, or changing the S3 bucket after you have placed your private CA in production could break existing certificates that depend on the CRL and the current CRL configuration\. Changing the alias can be done safely as long as the old alias remains linked to the correct bucket\. **To update the CRL configuration using the AWS console** 1. Sign in to your AWS account and open the ACM Private CA console at [https://console\.aws\.amazon\.com/acm\-pca/home](https://console.aws.amazon.com/acm-pca/home)\. 1. Choose **Private CAs**\. 1. Choose your private CA from the list\. 1. On the **Actions** menu, choose **Update CA revocation**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
ce87993b3bf5-1
1. Choose your private CA from the list\. 1. On the **Actions** menu, choose **Update CA revocation**\. 1. Select **Enable CRL distribution** to generate certificate revocation lists \(CRLs\)\. 1. For **Create a new S3 bucket**, choose **Yes** and type a unique bucket name or choose **No** and choose an existing bucket from the list\. 1. For **Custom CRL Name**, type an alias to hide your S3 bucket name from public view\. 1. For **Valid for**, type a validity period in days\. 1. Choose **Update**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
d57e677f7692-0
Tags are words or phrases that act as metadata for identifying and organizing AWS resources\. Each tag consists of a **key** and a **value**\. You can use the ACM Private CA console, AWS Command Line Interface \(AWS CLI\), or the PCA API to add, view, or remove tags for private CAs\. You can create custom tags that suit your needs\. For example, you could tag private CAs with the key\-value pairs of `Environment=Prod` or `Environment=Beta` to identify which environment the CA is intended for\. You can add tags to a CA at creation or any time after\. For more information, see [Create a Private CA](PcaCreateCa.md) Other AWS resources also support tagging\. You can assign the same tag to different resources to indicate whether those resources are related\. For example, you can assign a tag such as `Website=example.com` to your CA, the Elastic Load Balancing load balancer, and other related resources\. For more information on tagging AWS resources, see [Tagging your Amazon EC2 Resources](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) in the [Amazon EC2 User Guide for Linux Instances](https://docs.aws.amazon.com/ec2/index.html#lang/en_us)\. The following basic restrictions apply to ACM Private CA tags: + The maximum number of tags per private CA is 50\. + The maximum length of a tag key is 128 characters\. + The maximum length of a tag value is 256 characters\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
d57e677f7692-1
+ The maximum length of a tag key is 128 characters\. + The maximum length of a tag value is 256 characters\. + The tag key and value can contain the following characters: A\-Z, a\-z, and \.:\+=@\_%\-\(hyphen\)\. + Tag keys and values are case sensitive\. + The `aws:` and `rds:` prefixes are reserved for AWS use; you cannot add, edit, or delete tags whose key begins with `aws:` or `rds:`\. Default tags that begin with `aws:` and `rds:` do not count against your tags\-per\-resource quota\. + If you plan to use your tagging schema across multiple services and resources, remember that other services may have different restrictions for allowed characters\. Refer to the documentation for that service\. + ACM Private CA tags are not available for use in the AWS Management Console's [Resource Groups and Tag Editor](https://aws.amazon.com/blogs/aws/resource-groups-and-tagging/)\. You can tag a private CA from the [ACM Private CA Console](https://console.aws.amazon.com/acm-pca), the [AWS Command Line Interface \(AWS CLI\)](https://aws.amazon.com/cli/), or the [ACM Private CA API](https://docs.aws.amazon.com/acm-pca/latest/APIReference/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
d57e677f7692-2
**To tag a private CA \(console\)** 1. Sign in to your AWS account and open the ACM Private CA console at [https://console\.aws\.amazon\.com/acm\-pca/home](https://console.aws.amazon.com/acm-pca/home)\. 1. Choose **Private CAs**\. 1. Choose your private CA from the list\. 1. Choose the **Tags** tab\. 1. Choose **Edit**\. 1. Type a key and value pair\. 1. Choose **Add Tag**\. **To tag a private CA \(AWS CLI\)** Use the [tag\-certificate\-authority](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/tag-certificate-authority.html) command to add tags to your private CA\. ``` aws acm-pca tag-certificate-authority \ --certificate-authority-arn arn:aws:acm-pca:region:account:\ certificate-authority/12345678-1234-1234-1234-123456789012 \ --tags Key=Admin,Value=Alice ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
d57e677f7692-3
--tags Key=Admin,Value=Alice ``` Use the [list\-tags](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/list-tags.html) command to list the tags for a private CA\. ``` aws acm-pca list-tags \ --certificate-authority-arn arn:aws:acm-pca:region:account:\ certificate-authority/123455678-1234-1234-1234-123456789012 \ --max-results 10 ``` Use the [untag\-certificate\-authority](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/untag-certificate-authority.html) command to remove tags from a private CA\. ``` aws acm-pca untag-certificate-authority \ --certificate-authority-arn arn:aws:acm-pca:region:account:\ certificate-authority/12345678-1234-1234-1234-123456789012 \ --tags Key=Purpose,Value=Website ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCAUpdateCA.md
0976892da64f-0
The following Java sample shows how to use the [CreateCerticateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html) operation\. The operation creates a private subordinate certificate authority \(CA\)\. You must specify the CA configuration, the revocation configuration, the CA type, and an optional idempotency token\. The CA configuration specifies the following: + The name of the algorithm and key size to be used to create the CA private key + The type of signing algorithm that the CA uses to sign + X\.500 subject information The CRL configuration specifies the following: + The CRL expiration period in days \(the validity period of the CRL\) + The Amazon S3 bucket that will contain the CRL + A CNAME alias for the S3 bucket that is included in certificates issued by the CA If successful, this function returns the Amazon Resource Name \(ARN\) of the CA\. ``` 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;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePrivateCertificateAuthority.md
0976892da64f-1
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.ASN1Subject; import com.amazonaws.services.acmpca.model.CertificateAuthorityConfiguration; import com.amazonaws.services.acmpca.model.CertificateAuthorityType; import com.amazonaws.services.acmpca.model.CreateCertificateAuthorityResult; import com.amazonaws.services.acmpca.model.CreateCertificateAuthorityRequest; import com.amazonaws.services.acmpca.model.CrlConfiguration; import com.amazonaws.services.acmpca.model.KeyAlgorithm; import com.amazonaws.services.acmpca.model.SigningAlgorithm; import com.amazonaws.services.acmpca.model.Tag; import java.util.ArrayList; import java.util.Objects; import com.amazonaws.AmazonClientException;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePrivateCertificateAuthority.md
0976892da64f-2
import java.util.ArrayList; import java.util.Objects; import com.amazonaws.AmazonClientException; import com.amazonaws.services.acmpca.model.LimitExceededException; import com.amazonaws.services.acmpca.model.InvalidArgsException; import com.amazonaws.services.acmpca.model.InvalidPolicyException; import com.amazonaws.services.acmpca.model.RevocationConfiguration; public class CreateCertificateAuthority { 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 the credentials from the credential profiles file. " + "Please make sure that your credentials file is at the correct " + "location (C:\\Users\\joneps\\.aws\\credentials), and is in valid format.", e); } // Define the endpoint for your sample.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePrivateCertificateAuthority.md
0976892da64f-3
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(); // Define a CA subject. ASN1Subject subject = new ASN1Subject(); subject.setOrganization("Example Organization"); subject.setOrganizationalUnit("Example"); subject.setCountry("US"); subject.setState("Virginia"); subject.setLocality("Arlington"); subject.setCommonName("www.example.com"); // Define the CA configuration.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePrivateCertificateAuthority.md
0976892da64f-4
subject.setCommonName("www.example.com"); // Define the CA configuration. CertificateAuthorityConfiguration configCA = new CertificateAuthorityConfiguration(); configCA.withKeyAlgorithm(KeyAlgorithm.RSA_2048); configCA.withSigningAlgorithm(SigningAlgorithm.SHA256WITHRSA); configCA.withSubject(subject); // Define a certificate revocation list configuration. CrlConfiguration crlConfigure = new CrlConfiguration(); crlConfigure.withEnabled(true); crlConfigure.withExpirationInDays(365); crlConfigure.withCustomCname(null); crlConfigure.withS3BucketName("your-bucket-name"); RevocationConfiguration revokeConfig = new RevocationConfiguration(); revokeConfig.setCrlConfiguration(crlConfigure); // Define a certificate authority type: ROOT or SUBORDINATE CertificateAuthorityType CAtype = CertificateAuthorityType.<<SUBORDINATE>>; // Create a tag - method 1 Tag tag1 = new Tag(); tag1.withKey("PrivateCA");
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePrivateCertificateAuthority.md
0976892da64f-5
// Create a tag - method 1 Tag tag1 = new Tag(); tag1.withKey("PrivateCA"); tag1.withValue("Sample"); // Create a tag - method 2 Tag tag2 = new Tag() .withKey("Purpose") .withValue("WebServices"); // Add the tags to a collection. ArrayList<Tag> tags = new ArrayList<Tag>(); tags.add(tag1); tags.add(tag2); // Create the request object. CreateCertificateAuthorityRequest req = new CreateCertificateAuthorityRequest(); req.withCertificateAuthorityConfiguration(configCA); req.withRevocationConfiguration(revokeConfig); req.withIdempotencyToken("123987"); req.withCertificateAuthorityType(CAtype); req.withTags(tags); // Create the private CA. CreateCertificateAuthorityResult result = null; try { result = client.createCertificateAuthority(req); } catch (InvalidArgsException ex) { throw ex;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePrivateCertificateAuthority.md
0976892da64f-6
} catch (InvalidArgsException ex) { throw ex; } catch (InvalidPolicyException ex) { throw ex; } catch (LimitExceededException ex) { throw ex; } // Retrieve the ARN of the private CA. String arn = result.getCertificateAuthorityArn(); System.out.println(arn); } } ``` Your output should be similar to the following: ``` arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-CreatePrivateCertificateAuthority.md
8a663a28a6f1-0
The following Java sample shows how to use the [DeleteCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeleteCertificateAuthority.html) operation\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DeleteCertificateAuthority.md
8a663a28a6f1-1
This operation deletes the private certificate authority \(CA\) that you created using the [CreateCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html) operation\. The `DeleteCertificateAuthority` operation requires that you provide an ARN for the CA to be deleted\. You can find the ARN by calling the [ListCertificateAuthorities](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html) operation\. You can delete the private CA immediately if its status is `CREATING` or `PENDING_CERTIFICATE`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DeleteCertificateAuthority.md
8a663a28a6f1-2
its status is `CREATING` or `PENDING_CERTIFICATE`\. If you have already imported the certificate, however, you cannot delete it immediately\. You must first disable the CA by calling the [UpdateCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UpdateCertificateAuthority.html) operation and set the `Status` parameter to `DISABLED`\. You can then use the `PermanentDeletionTimeInDays` parameter in the `DeleteCertificateAuthority` operation to specify the number of days, from 7 to 30\. During that period the
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DeleteCertificateAuthority.md
8a663a28a6f1-3
from 7 to 30\. During that period the private CA can be restored to `disabled` status\. By default, if you do not set the `PermanentDeletionTimeInDays` parameter, the restoration period is 30 days\. After this period expires, the private CA is permanently deleted and cannot be restored\. For more information, see [Restore a CA](PCARestoreCA.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DeleteCertificateAuthority.md
8a663a28a6f1-4
For a Java example that shows you how to use the [RestoreCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RestoreCertificateAuthority.html) operation, see [RestoreCertificateAuthority](JavaApi-RestoreCertificateAuthority.md)\. ``` 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;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DeleteCertificateAuthority.md
8a663a28a6f1-5
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.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DeleteCertificateAuthority.md
8a663a28a6f1-6
// 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:region:account:" + "certificate-authority/11111111-2222-3333-4444-555555555555"); // 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; } }
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DeleteCertificateAuthority.md
8a663a28a6f1-7
throw ex; } catch (RequestFailedException ex) { throw ex; } } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DeleteCertificateAuthority.md
f2324986b203-0
You cannot revoke a self\-signed CA certificate\. Instead, you must delete the CA\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaRevokeSelfSigned.md
38e9aeb9242f-0
The following Java sample shows how to use the [DescribeCertificateAuthorityAuditReport](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DescribeCertificateAuthorityAuditReport.html) operation\. The operation lists information about a specific audit report that you created by calling the [CreateCertificateAuthorityAuditReport](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html) operation\. Audit information is created every time the certificate authority \(CA\) private key is used\. The private key is used when you issue a certificate, sign a CRL, or revoke a certificate\. ``` package com.amazonaws.samples; import java.util.Date; 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;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DescribeCertificateAuthorityAuditReport.md
38e9aeb9242f-1
import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder; import com.amazonaws.services.acmpca.model.DescribeCertificateAuthorityAuditReportRequest; import com.amazonaws.services.acmpca.model.DescribeCertificateAuthorityAuditReportResult; import com.amazonaws.AmazonClientException; import com.amazonaws.services.acmpca.model.InvalidArgsException; import com.amazonaws.services.acmpca.model.ResourceNotFoundException; import com.amazonaws.services.acmpca.model.AWSACMPCAException; import com.amazonaws.waiters.Waiter; import com.amazonaws.waiters.WaiterParameters; import com.amazonaws.waiters.WaiterTimedOutException; import com.amazonaws.waiters.WaiterUnrecoverableException; public class DescribeCertificateAuthorityAuditReport { 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();
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DescribeCertificateAuthorityAuditReport.md
38e9aeb9242f-2
try { credentials = new ProfileCredentialsProvider("default").getCredentials(); } catch (Exception e) { throw new AmazonClientException("Cannot load your credentials from file.", 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 request object. DescribeCertificateAuthorityAuditReportRequest req = new DescribeCertificateAuthorityAuditReportRequest(); // Set the certificate authority ARN. req.withCertificateAuthorityArn("arn:aws:acm-pca:region:account:" +
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DescribeCertificateAuthorityAuditReport.md
38e9aeb9242f-3
req.withCertificateAuthorityArn("arn:aws:acm-pca:region:account:" + "certificate-authority/12345678-1234-1234-1234-123456789012"); // Set the audit report ID. req.withAuditReportId("11111111-2222-3333-4444-555555555555"); // Create waiter to wait on successful creation of the audit report file. Waiter<DescribeCertificateAuthorityAuditReportRequest> waiter = client.waiters().auditReportCreated(); try { waiter.run(new WaiterParameters<>(req)); } catch (WaiterUnrecoverableException e) { //Explicit short circuit when the recourse transitions into //an undesired state. } catch (WaiterTimedOutException e) { //Failed to transition into desired state even after polling. } catch (AWSACMPCAException e) { //Unexpected service exception. } // Create a result object. DescribeCertificateAuthorityAuditReportResult result = null; try { result = client.describeCertificateAuthorityAuditReport(req); } catch (ResourceNotFoundException ex) { throw ex;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DescribeCertificateAuthorityAuditReport.md
38e9aeb9242f-4
} catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidArgsException ex) { throw ex; } String status = result.getAuditReportStatus(); String S3Bucket = result.getS3BucketName(); String S3Key = result.getS3Key(); Date createdAt = result.getCreatedAt(); System.out.println(status); System.out.println(S3Bucket); System.out.println(S3Key); System.out.println(createdAt); } } ``` Your output should be similar to the following: ``` SUCCESS your-audit-report-bucket-name audit-report/a4119411-8153-498a-a607-2cb77b858043/25211c3d-f2fe-479f-b437-fe2b3612bc45.json Tue Jan 16 13:07:58 PST 2018 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-DescribeCertificateAuthorityAuditReport.md
0fde46e70fe6-0
An ACM Private CA command might fail for several reasons\. For information on each exception and recommendations for resolving them, see the table below\. **ACM Private CA Exceptions** | Exception Returned by ACM Private CA | Description | Recommendation | | --- | --- | --- | | <a name="AccessDeniedException"></a>`AccessDeniedException` | The permissions required to use the given command have not been delegated by a private CA to the calling account\. | For information on delegating permissions in ACM Private CA, see [Assign Certificate Renewal Permissions to ACM](granting-ca-access.md#PcaPermissions)\. | | <a name="InvalidArgsException"></a>`InvalidArgsException` | A certificate creation or renewal request was made with invalid parameters\. | Check the command's individual documentation to make sure that your input parameters are valid\. If you are creating a new certificate, make sure that the requested signing algorithm can be used with the CA's key type\. | | <a name="InvalidStateException"></a>`InvalidStateException` | The associated private CA cannot renew the certificate because it is not in the ACTIVE state\. | Attempt to [restore the private CA](PCARestoreCA.md)\. If the private CA is outside of its restoration period, the CA cannot be restored and the certificate cannot be renewed\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCATsExceptions.md
0fde46e70fe6-1
| <a name="LimitExceededException"></a>`LimitExceededException` | Each certificate authority \(CA\) has a quota of certificates that it can issue\. The private CA that is associated with the designated certificate has reached its quota\. For more information, see [Quotas](PcaLimits.md)\. | Contact the [AWS Support Center](https://aws.amazon.com/premiumsupport/) to request a quota increase\. | | <a name="MalformedCSRException"></a>`MalformedCSRException` | The certificate signing request \(CSR\) that was submitted to ACM Private CA cannot be verified or validated\. | Confirm that your CSR was properly generated and configured\. | | `OtherException` | An internal error has caused the request to fail\. | Attempt to run the command again\. If the problem persists, contact the [AWS Support Center](https://aws.amazon.com/premiumsupport/)\. | | <a name="RequestFailedException"></a>`RequestFailedException` | A networking problem in your AWS environment caused the request to fail\. | Retry the request\. If the failure persists, check your [Amazon VPC \(VPC\) configuration](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html)\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCATsExceptions.md
0fde46e70fe6-2
| <a name="ResourceNotFoundException"></a>`ResourceNotFoundException` | The private CA that issued the certificate was deleted and no longer exists\. | Request a new certificate from another active CA\. | | <a name="ThrottlingException"></a>`ThrottlingException` | A requested API action failed because it exceeded a quota\. | Confirm that you are not issuing more calls than allowed by the ACM Private CA [service quotas](PcaLimits.md)\. A `ThrottlingException` error may also occur because you have encountered a transient condition rather than from an exceeded quota\. If you encounter the error and you have not been making calls in excess of the quota, try your request again\. If you are running up against a quota, you may be able to request an increase\. For more information, see [Quotas on API Requests](PcaLimits.md#PcaLimits-api)\. | | <a name="ValidationException"></a>`ValidationException` | The request's input parameters were incorrectly formatted, or the validity period of the root certificate ends before the validity period of the requested certificate\. | Check the syntax requirements of the command's input parameters as well as the validity period of your CA's root certificate\. For information about changing the validity period, see [Updating Your Private CA](PCAUpdateCA.md)\. |
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PCATsExceptions.md
c926c4573b2a-0
The following CloudTrail example shows the results of a call to the [RevokeCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html) operation\. ``` { "eventVersion":"1.05", "userIdentity":{ "type":"IAMUser", "principalId":"account", "arn":"arn:aws:iam::account:user/name "accessKeyId": "Key_ID" }, "eventTime": "2018-01-26T22:35:03Z", "eventSource": "acm-pca.amazonaws.com", "eventName": "RevokeCertificate", "awsRegion": "us-east-1", "sourceIPAddress": "xx.xx.xx.xx", "userAgent": "aws-cli/1.14.28 Python/2.7.9 Windows/8 botocore/1.8.32", "requestParameters": {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-RevokeCertificate.md
c926c4573b2a-1
"requestParameters": { "certificateAuthorityArn": ""arn":"aws":"acm-pca":"region":"account":certificate-authority/ac5a7c2e-19c8-4258-b74e-351c2b791fe1", "certificateSerial": "67:07:44:76:83:a9:b7:f4:05:56:27:"ff":d5:5c:"eb":"cc", "revocationReason": "KEY_COMPROMISE" }, "responseElements": null, "requestID": "fb43ebee-a065-4b08-af60-29fd611bfa09", "eventID": "06b7d2bf-3b4d-46ee-b617-6531ba2aa290", "eventType": "AwsApiCall", "recipientAccountId": "account" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-RevokeCertificate.md
f1c1d975b290-0
Using ACM Private CA, you can create an entirely AWS\-hosted private certificate authority \(CA\) for internal use by your organization\. You can also a tie a certificate revocation list \(CRL\) to your CA\. The root CA certificate, any subordinate CA certificates, and the CRL are stored and managed by ACM Private CA\. The private key for your root authority is securely stored in AWS\. **Note** You have the option of encrypting your CRL\. For more information, see [Encrypting Your CRLs ](PcaCreateCa.md#crl-encryption)\. You can access ACM Private CA using the AWS Management Console, the AWS CLI, and the ACM Private CA API\. The following topics show you how to use the console and the CLI\. To learn more about the API, see the [AWS Certificate Manager Private Certificate Authority API Reference](https://docs.aws.amazon.com/acm-pca/latest/APIReference/)\. For Java examples that show you how to use the API, see [Using the ACM Private CA API \(Java Examples\)](PcaApiIntro.md)\. **Topics** + [Setting Up ACM Private CA](PcaGettingStarted.md) + [Creating a Private CA and CRL](PcaCreateCa.md) + [Creating and Installing the Certificate for a Private CA](PCACertInstall.md) + [Enabling Access to a Private CA](granting-ca-access.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaCreatingManagingCA.md
f1c1d975b290-1
+ [Enabling Access to a Private CA](granting-ca-access.md) + [Updating Your Private CA](PCAUpdateCA.md) + [Deleting Your Private CA](PCADeleteCA.md) + [Restoring Your Private CA](PCARestoreCA.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaCreatingManagingCA.md
d0a27b16a10f-0
ACM Private CA gives you complete, cloud\-based control over your organization's private PKI \(public key infrastructure\), extending from a root certificate authority \(CA\), through subordinate CAs, to end\-entity certificates\. Thorough planning is essential for a PKI that is secure, maintainable, extensible, and suited to your organization's needs\. This section provides guidance on designing a CA hierarchy, managing your private CA and private end\-entity certificate lifecycles, and applying best practices for security\. **Topics** + [Designing a CA Hierarchy](ca-hierarchy.md) + [Managing the Private CA Lifecycle](ca-lifecycle.md) + [Resilience in AWS Certificate Manager Private Certificate Authority](disaster-recovery-resilience.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaPlanning.md
06d98bb5e7a8-0
You can create a private connection between your VPC and ACM Private CA by configuring an interface VPC endpoint\. Interface endpoints are powered by [AWS PrivateLink](https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/aws-privatelink.html), a technology for privately accessing ACM Private CA API operations\. AWS PrivateLink routes all network traffic between your VPC and ACM Private CA through the Amazon network, avoiding exposure on the open internet\. Each VPC endpoint is represented by one or more [Elastic Network Interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) \(ENIs\) with private IP addresses in your VPC subnets\. The interface VPC endpoint connects your VPC directly to ACM Private CA without an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection\. The instances in your VPC don't need public IP addresses to communicate with the ACM Private CA API\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/vpc-endpoints.md
06d98bb5e7a8-1
To use ACM Private CA through your VPC, you must connect from an instance that is inside the VPC\. Alternatively, you can connect your private network to your VPC by using an AWS Virtual Private Network \(AWS VPN\) or AWS Direct Connect\. For information about AWS VPN, see [VPN Connections](https://docs.aws.amazon.com/vpc/latest/userguide/vpn-connections.html) in the *Amazon VPC User Guide*\. For information about AWS Direct Connect, see [Creating a Connection](https://docs.aws.amazon.com/directconnect/latest/UserGuide/create-connection.html) in the *AWS Direct Connect User Guide*\. ACM Private CA does not require the use of AWS PrivateLink, but we recommend it as an additional layer of security\. For more information about AWS PrivateLink and VPC endpoints, see [Accessing Services Through AWS PrivateLink](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html#what-is-privatelink)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/vpc-endpoints.md
2dc5cbf1f393-0
Before you set up interface VPC endpoints for ACM Private CA, be aware of the following considerations: + ACM Private CA may not support VPC endpoints in some Availability Zones\. When you create a VPC endpoint, first check support in the management console\. Unsupported Availability Zones are marked "Service not supported in this Availability Zone\." + VPC endpoints do not support cross\-Region requests\. Ensure that you create your endpoint in the same Region where you plan to issue your API calls to ACM Private CA\. + VPC endpoints only support Amazon\-provided DNS through Amazon RouteΒ 53\. If you want to use your own DNS, you can use conditional DNS forwarding\. For more information, see [DHCP Options Sets](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html) in the *Amazon VPC User Guide*\. + The security group attached to the VPC endpoint must allow incoming connections on port 443 from the private subnet of the VPC\. + AWS Certificate Manager does not support VPC endpoints\. + FIPS endpoints \(and their Regions\) do not support VPC endpoints\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/vpc-endpoints.md
ad8379b76f70-0
You can create a VPC endpoint for the ACM Private CA service using either the VPC console at [https://console\.aws\.amazon\.com/vpc/](https://console.aws.amazon.com/vpc/) or the AWS Command Line Interface\. For more information, see the [Creating an Interface Endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#create-interface-endpoint) procedure in the *Amazon VPC User Guide*\. ACM Private CA supports making calls to all of its API operations inside your VPC\. If you have enabled private DNS host names for the endpoint, then the default ACM Private CA endpoint now resolves to your VPC endpoint\. For a comprehensive list of default service endpoints, see [Service Endpoints and Quotas](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html)\. If you have not enabled private DNS host names, Amazon VPC provides a DNS endpoint name that you can use in the following format: ``` vpc-endpoint-id.acm-pca.region.vpce.amazonaws.com ``` **Note**
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/vpc-endpoints.md
ad8379b76f70-1
``` **Note** The value *region* represents the Region identifier for an AWS Region supported by ACM Private CA, such as `us-east-2` for the US East \(Ohio\) Region\. For a list of ACM Private CA, see [AWS Certificate Manager Private Certificate Authority Endpoints and Quotas](https://docs.aws.amazon.com/general/latest/gr/acm-pca.html)\. For more information, see [Interface VPC Endpoints \(AWS PrivateLink\)](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html) in the *Amazon VPC User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/vpc-endpoints.md
a295ad037e3e-0
You can create a policy for Amazon VPC endpoints for ACM Private CA to specify the following: + The principal that can perform actions\. + The actions that can be performed\. + The resources on which actions can be performed\. For more information, see [Controlling Access to Services with VPC Endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) in the *Amazon VPC User Guide*\. **Example – VPC endpoint policy for ACM Private CA actions** When attached to an endpoint, the following policy grants access for all principals to the ACM Private CA actions `IssueCertificate`, `DescribeCertificateAuthority`, `GetCertificate`, `GetCertificateAuthorityCertificate`, `ListPermissions`, and `ListTags`\. The resource in each stanza is a private CA\. The first stanza authorizes the creation of end\-entity certificates using the specified private CA and certificate template\. If you don't want to control the template being used, the `Condition` section is not needed\. However, removing this allows all principals to create CA certificates as well as end\-entity certificates\. ``` { "Statement":[ { "Principal":"*", "Effect":"Allow", "Action":[ "acm-pca:IssueCertificate" ],
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/vpc-endpoints.md
a295ad037e3e-1
"Action":[ "acm-pca:IssueCertificate" ], "Resource":[ "arn:aws:acm-pca:us-east-1:555555555555:certificate-authority/12345678-1234567890-1234" ], "Condition":{ "StringEquals":{ "acm-pca:TemplateArn":"arn:aws:acm-pca:::template/EndEntityCertificate/V1" } } }, { "Principal":"*", "Effect":"Allow", "Action":[ "acm-pca:DescribeCertificateAuthority", "acm-pca:GetCertificate", "acm-pca:GetCertificateAuthorityCertificate", "acm-pca:ListPermissions", "acm-pca:ListTags" ], "Resource":[ "arn:aws:acm-pca:us-east-1:555555555555:certificate-authority/12345678-1234567890-1234" ] } ] }
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/vpc-endpoints.md
a295ad037e3e-2
] } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/vpc-endpoints.md
ed6a6b8830f2-0
The following Java sample shows how to use the [IssueCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html) operation\. This operation uses your private certificate authority \(CA\) to issue an end\-entity certificate\. This operation returns the Amazon Resource Name \(ARN\) of the certificate\. You can retrieve the certificate by calling the [GetCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificate.html) and specifying the ARN\. **Note** The [IssueCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html) operation requires you to specify a certificate template\. This example uses the `EndEntityCertificate/V1` template\. For information about all of the available templates, see [Understanding Certificate Templates](UsingTemplates.md)\. ``` 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;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-IssueCertificate.md
ed6a6b8830f2-1
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration; import com.amazonaws.auth.AWSStaticCredentialsProvider; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Objects; import com.amazonaws.services.acmpca.AWSACMPCA; import com.amazonaws.services.acmpca.AWSACMPCAClientBuilder; import com.amazonaws.services.acmpca.model.IssueCertificateRequest; import com.amazonaws.services.acmpca.model.IssueCertificateResult; import com.amazonaws.services.acmpca.model.SigningAlgorithm; import com.amazonaws.services.acmpca.model.Validity; import com.amazonaws.AmazonClientException; import com.amazonaws.services.acmpca.model.LimitExceededException; import com.amazonaws.services.acmpca.model.ResourceNotFoundException; import com.amazonaws.services.acmpca.model.InvalidStateException; import com.amazonaws.services.acmpca.model.InvalidArnException; import com.amazonaws.services.acmpca.model.InvalidArgsException;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-IssueCertificate.md
ed6a6b8830f2-2
import com.amazonaws.services.acmpca.model.InvalidArgsException; import com.amazonaws.services.acmpca.model.MalformedCSRException; public class IssueCertificate { public static ByteBuffer stringToByteBuffer(final String string) { if (Objects.isNull(string)) { return null; } byte[] bytes = string.getBytes(StandardCharsets.UTF_8); return ByteBuffer.wrap(bytes); } 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 =
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-IssueCertificate.md
ed6a6b8830f2-3
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 certificate request: IssueCertificateRequest req = new IssueCertificateRequest(); // Set the CA ARN. req.withCertificateAuthorityArn("arn:aws:acm-pca:region:account:" + "certificate-authority/12345678-1234-1234-1234-123456789012"); // Specify the certificate signing request (CSR) for the certificate to be signed and issued. String strCSR = "-----BEGIN CERTIFICATE REQUEST-----\n" + "base64-encoded certificate\n" + "-----END CERTIFICATE REQUEST-----\n"; ByteBuffer csrByteBuffer = stringToByteBuffer(strCSR); req.setCsr(csrByteBuffer);
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-IssueCertificate.md
ed6a6b8830f2-4
req.setCsr(csrByteBuffer); // Specify the template for the issued certificate. req.withTemplateArn("arn:aws:acm-pca:::template/EndEntityCertificate/V1"); // Set the signing algorithm. req.withSigningAlgorithm(SigningAlgorithm.SHA256WITHRSA); // Set the validity period for the certificate to be issued. Validity validity = new Validity(); validity.withValue(<<3650L>>); validity.withType("DAYS"); req.withValidity(validity); // Set the idempotency token. req.setIdempotencyToken("1234"); // Issue the certificate. IssueCertificateResult result = null; try { result = client.issueCertificate(req); } catch (LimitExceededException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidStateException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } catch (InvalidArgsException ex) { throw ex;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-IssueCertificate.md
ed6a6b8830f2-5
throw ex; } catch (InvalidArgsException ex) { throw ex; } catch (MalformedCSRException ex) { throw ex; } // Retrieve and display the certificate ARN. String arn = result.getCertificateArn(); System.out.println(arn); } } ``` Your output should be similar to the following: ``` arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012/certificate/2669d5cacb539c0830998c23babab8dc ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-IssueCertificate.md
bf7bee2aae51-0
You can use the ACM Private CA API and AWS CLI to issue a private certificate\. If you do, you can use the AWS CLI or ACM Private CA API to retrieve that certificate\. If you used ACM to create your private CA and to request certificates, you must use ACM to export the certificate and the encrypted private key\. For more information, see [Exporting a Private Certificate](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-export-private.html)\. Use the [get\-certificate](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/get-certificate.html) command to retrieve a private certificate\. You can also use the [GetCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificate.html) operation\. Use the `--output text` option to output the certificate without <CR><LF> pairs\. **Note** If you want to revoke a certificate, you can use the get\-certificate command to retrieve the serial number in hexadecimal format\. You can also create an audit report to retrieve the hex serial number\. For more information, see [Using Audit Reports with Your Private CA](PcaAuditReport.md)\. ``` aws acm-pca get-certificate \ --certificate-authority-arn arn:aws:acm-pca:region:account:\
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaGetCert.md
bf7bee2aae51-1
--certificate-authority-arn arn:aws:acm-pca:region:account:\ certificate-authority/12345678-1234-1234-1234-123456789012 \ --certificate-arn arn:aws:acm-pca:region:account:\ certificate-authority/12345678-1234-1234-1234-123456789012/\ certificate/6707447683a9b7f4055627ffd55cebcc \ --output text ``` This command outputs the base64 encoded PEM format certificate and the certificate chain\. ``` -----BEGIN CERTIFICATE----- ...Base64-encoded certificate... -----END CERTIFICATE---- -----BEGIN CERTIFICATE----- ...Base64-encoded certificate... -----END CERTIFICATE---- -----BEGIN CERTIFICATE----- ...Base64-encoded certificate... -----END CERTIFICATE---- ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/PcaGetCert.md
d20fcee9799d-0
As a managed service, ACM Private CA is protected by the AWS global network security procedures that are described in the [Amazon Web Services: Overview of Security Processes](https://d0.awsstatic.com/whitepapers/Security/AWS_Security_Whitepaper.pdf) whitepaper\. You use AWS published API calls to access ACM Private CA through the network\. Clients must support Transport Layer Security \(TLS\) 1\.0 or later\. We recommend TLS 1\.2 or later\. Clients must also support cipher suites with perfect forward secrecy \(PFS\) such as Ephemeral Diffie\-Hellman \(DHE\) or Elliptic Curve Ephemeral Diffie\-Hellman \(ECDHE\)\. Most modern systems such as Java 7 and later support these modes\. Additionally, requests must be signed by using an access key ID and a secret access key that is associated with an IAM principal\. Or you can use the [AWS Security Token Service](https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html) \(AWS STS\) to generate temporary security credentials to sign requests\. **Topics** + [ACM Private CA VPC Endpoints \(AWS PrivateLink\)](vpc-endpoints.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/infrastructure-security.md
f7863a0f9755-0
This Java sample shows how to activate a subordinate CA using the following ACM Private CA API actions: + [GetCertificateAuthorityCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificateAuthorityCertificate.html) + [CreateCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html) + [GetCertificateAuthorityCsr](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificateAuthorityCsr.html) + [IssueCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html) + [GetCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificate.html) + [ImportCertificateAuthorityCertificate](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html) ``` package com.amazonaws.samples; import com.amazonaws.auth.AWSCredentials;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-1
``` 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.ASN1Subject; import com.amazonaws.services.acmpca.model.CertificateAuthorityConfiguration; import com.amazonaws.services.acmpca.model.CertificateAuthorityType; import com.amazonaws.services.acmpca.model.CreateCertificateAuthorityResult; import com.amazonaws.services.acmpca.model.CreateCertificateAuthorityRequest; import com.amazonaws.services.acmpca.model.CrlConfiguration; import com.amazonaws.services.acmpca.model.KeyAlgorithm;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-2
import com.amazonaws.services.acmpca.model.KeyAlgorithm; import com.amazonaws.services.acmpca.model.SigningAlgorithm; import com.amazonaws.services.acmpca.model.Tag; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Objects; import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCertificateRequest; import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCertificateResult; import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCsrRequest; import com.amazonaws.services.acmpca.model.GetCertificateAuthorityCsrResult; import com.amazonaws.services.acmpca.model.GetCertificateRequest; import com.amazonaws.services.acmpca.model.GetCertificateResult; import com.amazonaws.services.acmpca.model.ImportCertificateAuthorityCertificateRequest; import com.amazonaws.services.acmpca.model.IssueCertificateRequest; import com.amazonaws.services.acmpca.model.IssueCertificateResult;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-3
import com.amazonaws.services.acmpca.model.IssueCertificateResult; import com.amazonaws.services.acmpca.model.SigningAlgorithm; import com.amazonaws.services.acmpca.model.Validity; import com.amazonaws.AmazonClientException; import com.amazonaws.services.acmpca.model.CertificateMismatchException; import com.amazonaws.services.acmpca.model.ConcurrentModificationException; import com.amazonaws.services.acmpca.model.LimitExceededException; import com.amazonaws.services.acmpca.model.InvalidArgsException; import com.amazonaws.services.acmpca.model.InvalidArnException; import com.amazonaws.services.acmpca.model.InvalidPolicyException; import com.amazonaws.services.acmpca.model.InvalidStateException; import com.amazonaws.services.acmpca.model.MalformedCertificateException; import com.amazonaws.services.acmpca.model.MalformedCSRException; import com.amazonaws.services.acmpca.model.RequestFailedException; import com.amazonaws.services.acmpca.model.RequestInProgressException; import com.amazonaws.services.acmpca.model.ResourceNotFoundException;
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-4
import com.amazonaws.services.acmpca.model.ResourceNotFoundException; import com.amazonaws.services.acmpca.model.RevocationConfiguration; import com.amazonaws.services.acmpca.model.AWSACMPCAException; import com.amazonaws.waiters.Waiter; import com.amazonaws.waiters.WaiterParameters; import com.amazonaws.waiters.WaiterTimedOutException; import com.amazonaws.waiters.WaiterUnrecoverableException; public class SubordinateCAActivation { public static void main(String[] args) throws Exception { // Place your own Root CA ARN here. String rootCAArn = "arn:aws:acm-pca:region:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012"; // Define the endpoint region for your sample. String endpointRegion = "region"; // Substitute your region here, e.g. "us-west-2" // Define a CA subject. ASN1Subject subject = new ASN1Subject(); subject.setOrganization("Example Organization"); subject.setOrganizationalUnit("Example"); subject.setCountry("US");
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-5
subject.setOrganizationalUnit("Example"); subject.setCountry("US"); subject.setState("Virginia"); subject.setLocality("Arlington"); subject.setCommonName("www.example.com"); // Define the CA configuration. CertificateAuthorityConfiguration configCA = new CertificateAuthorityConfiguration(); configCA.withKeyAlgorithm(KeyAlgorithm.RSA_2048); configCA.withSigningAlgorithm(SigningAlgorithm.SHA256WITHRSA); configCA.withSubject(subject); // Define a certificate revocation list configuration. CrlConfiguration crlConfigure = new CrlConfiguration(); crlConfigure.withEnabled(true); crlConfigure.withExpirationInDays(365); crlConfigure.withCustomCname(null); crlConfigure.withS3BucketName("your-bucket-name"); // Define a certificate authority type CertificateAuthorityType CAtype = CertificateAuthorityType.SUBORDINATE; // ** Execute core code samples for Subordinate CA activation in sequence ** AWSACMPCA client = ClientBuilder(endpointRegion);
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-6
// ** Execute core code samples for Subordinate CA activation in sequence ** AWSACMPCA client = ClientBuilder(endpointRegion); String rootCertificate = GetCertificateAuthorityCertificate(rootCAArn, client); String subordinateCAArn = CreateCertificateAuthority(configCA, crlConfigure, CAtype, client); String csr = GetCertificateAuthorityCsr(subordinateCAArn, client); String subordinateCertificateArn = IssueCertificate(rootCAArn, csr, client); String subordinateCertificate = GetCertificate(subordinateCertificateArn, rootCAArn, client); ImportCertificateAuthorityCertificate(subordinateCertificate, rootCertificate, subordinateCAArn, client); } private static AWSACMPCA ClientBuilder(String endpointRegion) { // 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 the credentials from the credential profiles file. " +
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-7
} catch (Exception e) { throw new AmazonClientException( "Cannot load the credentials from the credential profiles file. " + "Please make sure that your credentials file is at the correct " + "location (C:\\Users\\joneps\\.aws\\credentials), and is in valid format.", e); } 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(); return client; } private static String GetCertificateAuthorityCertificate(String rootCAArn, AWSACMPCA client) { // ** GetCertificateAuthorityCertificate ** // Create a request object and set the certificate authority ARN, GetCertificateAuthorityCertificateRequest getCACertificateRequest =
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-8
GetCertificateAuthorityCertificateRequest getCACertificateRequest = new GetCertificateAuthorityCertificateRequest(); getCACertificateRequest.withCertificateAuthorityArn(rootCAArn); // Create a result object. GetCertificateAuthorityCertificateResult getCACertificateResult = null; try { getCACertificateResult = client.getCertificateAuthorityCertificate(getCACertificateRequest); } catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidStateException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } // Retrieve and display the certificate information. String rootCertificate = getCACertificateResult.getCertificate(); System.out.println("Root CA Certificate / Certificate Chain:"); System.out.println(rootCertificate); return rootCertificate; } private static String CreateCertificateAuthority(CertificateAuthorityConfiguration configCA, CrlConfiguration crlConfigure, CertificateAuthorityType CAtype, AWSACMPCA client) {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-9
RevocationConfiguration revokeConfig = new RevocationConfiguration(); revokeConfig.setCrlConfiguration(crlConfigure); // Create the request object. CreateCertificateAuthorityRequest createCARequest = new CreateCertificateAuthorityRequest(); createCARequest.withCertificateAuthorityConfiguration(configCA); createCARequest.withRevocationConfiguration(revokeConfig); createCARequest.withIdempotencyToken("123987"); createCARequest.withCertificateAuthorityType(CAtype); // Create the private CA. CreateCertificateAuthorityResult createCAResult = null; try { createCAResult = client.createCertificateAuthority(createCARequest); } catch (InvalidArgsException ex) { throw ex; } catch (InvalidPolicyException ex) { throw ex; } catch (LimitExceededException ex) { throw ex; } // Retrieve the ARN of the private CA. String subordinateCAArn = createCAResult.getCertificateAuthorityArn(); System.out.println("Subordinate CA Arn: " + subordinateCAArn);
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-10
System.out.println("Subordinate CA Arn: " + subordinateCAArn); return subordinateCAArn; } private static String GetCertificateAuthorityCsr(String subordinateCAArn, AWSACMPCA client) { // Create the CSR request object and set the CA ARN. GetCertificateAuthorityCsrRequest csrRequest = new GetCertificateAuthorityCsrRequest(); csrRequest.withCertificateAuthorityArn(subordinateCAArn); // Create waiter to wait on successful creation of the CSR file. Waiter<GetCertificateAuthorityCsrRequest> getCSRWaiter = client.waiters().certificateAuthorityCSRCreated(); try { getCSRWaiter.run(new WaiterParameters<>(csrRequest)); } catch (WaiterUnrecoverableException e) { //Explicit short circuit when the recourse transitions into //an undesired state. } catch (WaiterTimedOutException e) { //Failed to transition into desired state even after polling. } catch(AWSACMPCAException e) { //Unexpected service exception. } // Retrieve the CSR. GetCertificateAuthorityCsrResult csrResult = null; try {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-11
// Retrieve the CSR. GetCertificateAuthorityCsrResult csrResult = null; try { csrResult = client.getCertificateAuthorityCsr(csrRequest); } catch (RequestInProgressException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } catch (RequestFailedException ex) { throw ex; } // Retrieve and display the CSR; String csr = csrResult.getCsr(); System.out.println("Subordinate CSR:"); System.out.println(csr); return csr; } private static String IssueCertificate(String rootCAArn, String csr, AWSACMPCA client) { // Create a certificate request: IssueCertificateRequest issueRequest = new IssueCertificateRequest(); // Set the issuing CA ARN. issueRequest.withCertificateAuthorityArn(rootCAArn); // Set the template ARN.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-12
issueRequest.withCertificateAuthorityArn(rootCAArn); // Set the template ARN. issueRequest.withTemplateArn("arn:aws:acm-pca:::template/SubordinateCACertificate_PathLen0/V1"); ByteBuffer csrByteBuffer = stringToByteBuffer(csr); issueRequest.setCsr(csrByteBuffer); // Set the signing algorithm. issueRequest.withSigningAlgorithm(SigningAlgorithm.SHA256WITHRSA); // Set the validity period for the certificate to be issued. Validity validity = new Validity(); validity.withValue(730L); // Approximately two years validity.withType("DAYS"); issueRequest.withValidity(validity); // Set the idempotency token. issueRequest.setIdempotencyToken("1234"); // Issue the certificate. IssueCertificateResult issueResult = null; try { issueResult = client.issueCertificate(issueRequest); } catch (LimitExceededException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidStateException ex) {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-13
} catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidStateException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } catch (InvalidArgsException ex) { throw ex; } catch (MalformedCSRException ex) { throw ex; } // Retrieve and display the certificate ARN. String subordinateCertificateArn = issueResult.getCertificateArn(); System.out.println("Subordinate Certificate Arn: " + subordinateCertificateArn); return subordinateCertificateArn; } private static String GetCertificate(String subordinateCertificateArn, String rootCAArn, AWSACMPCA client) { // Create a request object. GetCertificateRequest certificateRequest = new GetCertificateRequest(); // Set the certificate ARN. certificateRequest.withCertificateArn(subordinateCertificateArn); // Set the certificate authority ARN. certificateRequest.withCertificateAuthorityArn(rootCAArn); // Create waiter to wait on successful creation of the certificate file.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-14
// Create waiter to wait on successful creation of the certificate file. Waiter<GetCertificateRequest> getCertificateWaiter = client.waiters().certificateIssued(); try { getCertificateWaiter.run(new WaiterParameters<>(certificateRequest)); } catch (WaiterUnrecoverableException e) { //Explicit short circuit when the recourse transitions into //an undesired state. } catch (WaiterTimedOutException e) { //Failed to transition into desired state even after polling. } catch (AWSACMPCAException e) { //Unexpected service exception. } // Retrieve the certificate and certificate chain. GetCertificateResult certificateResult = null; try { certificateResult = client.getCertificate(certificateRequest); } catch (RequestInProgressException ex) { throw ex; } catch (RequestFailedException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } catch (InvalidStateException ex) { throw ex; } // Get the certificate and certificate chain and display the result.
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-15
throw ex; } // Get the certificate and certificate chain and display the result. String subordinateCertificate = certificateResult.getCertificate(); System.out.println("Subordinate CA Certificate:"); System.out.println(subordinateCertificate); return subordinateCertificate; } private static void ImportCertificateAuthorityCertificate(String subordinateCertificate, String rootCertificate, String subordinateCAArn, AWSACMPCA client) { // Create the request object and set the signed certificate, chain and CA ARN. ImportCertificateAuthorityCertificateRequest importRequest = new ImportCertificateAuthorityCertificateRequest(); ByteBuffer certByteBuffer = stringToByteBuffer(subordinateCertificate); importRequest.setCertificate(certByteBuffer); ByteBuffer rootCACertByteBuffer = stringToByteBuffer(rootCertificate); importRequest.setCertificateChain(rootCACertByteBuffer); // Set the certificate authority ARN. importRequest.withCertificateAuthorityArn(subordinateCAArn); // Import the certificate. try {
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
f7863a0f9755-16
importRequest.withCertificateAuthorityArn(subordinateCAArn); // Import the certificate. try { client.importCertificateAuthorityCertificate(importRequest); } catch (CertificateMismatchException ex) { throw ex; } catch (MalformedCertificateException ex) { throw ex; } catch (InvalidArnException ex) { throw ex; } catch (ResourceNotFoundException ex) { throw ex; } catch (RequestInProgressException ex) { throw ex; } catch (ConcurrentModificationException ex) { throw ex; } catch (RequestFailedException ex) { throw ex; } System.out.println("Subordinate CA certificate successfully imported."); System.out.println("Subordinate CA activated successfully."); } private static ByteBuffer stringToByteBuffer(final String string) { if (Objects.isNull(string)) { return null; } byte[] bytes = string.getBytes(StandardCharsets.UTF_8); return ByteBuffer.wrap(bytes); } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/JavaApi-ActivateSubordinateCA.md
4051c2b1c41c-0
The following CloudTrail example shows the results of a call to the [CreateCertificateAuthority](https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html) operation\. ``` { "eventVersion":"1.05", "userIdentity":{ "type":"IAMUser", "principalId":"account", "arn":"arn:aws:iam::account:user/name", "accountId":"account", "accessKeyId":"Key_ID" }, "eventTime":"2018-01-26T21:22:33Z", "eventSource":"acm-pca.amazonaws.com", "eventName":"CreateCertificateAuthority", "awsRegion":"us-east-1", "sourceIPAddress":"xx.xx.xx.xx", "userAgent":"aws-cli/1.14.28 Python/2.7.9 Windows/8 botocore/1.8.32", "requestParameters":{ "certificateAuthorityConfiguration":{ "keyType":"RSA2048",
https://github.com/siagholami/aws-documentation/tree/main/documents/aws-private-ca-user-guide/doc_source/CT-CreateCA.md