CreateCertificateAuthority
Creates a root or subordinate private certificate authority (CA). You must specify the CA configuration, an optional configuration for Online Certificate Status Protocol (OCSP) and/or a certificate revocation list (CRL), the CA type, and an optional idempotency token to avoid accidental creation of multiple CAs. The CA configuration specifies 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, and X.500 subject information. The OCSP configuration can optionally specify a custom URL for the OCSP responder. The CRL configuration specifies the CRL expiration period in days (the validity period of the CRL), the Amazon S3 bucket that will contain the CRL, and a CNAME alias for the S3 bucket that is included in certificates issued by the CA. If successful, this action returns the Amazon Resource Name (ARN) of the CA.
Note
Both AWS Private CA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see Access policies for CRLs in Amazon S3.
AWS Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see Encrypting Your CRLs.
Request Syntax
{
"CertificateAuthorityConfiguration": {
"CsrExtensions": {
"KeyUsage": {
"CRLSign": boolean
,
"DataEncipherment": boolean
,
"DecipherOnly": boolean
,
"DigitalSignature": boolean
,
"EncipherOnly": boolean
,
"KeyAgreement": boolean
,
"KeyCertSign": boolean
,
"KeyEncipherment": boolean
,
"NonRepudiation": boolean
},
"SubjectInformationAccess": [
{
"AccessLocation": {
"DirectoryName": {
"CommonName": "string
",
"Country": "string
",
"CustomAttributes": [
{
"ObjectIdentifier": "string
",
"Value": "string
"
}
],
"DistinguishedNameQualifier": "string
",
"GenerationQualifier": "string
",
"GivenName": "string
",
"Initials": "string
",
"Locality": "string
",
"Organization": "string
",
"OrganizationalUnit": "string
",
"Pseudonym": "string
",
"SerialNumber": "string
",
"State": "string
",
"Surname": "string
",
"Title": "string
"
},
"DnsName": "string
",
"EdiPartyName": {
"NameAssigner": "string
",
"PartyName": "string
"
},
"IpAddress": "string
",
"OtherName": {
"TypeId": "string
",
"Value": "string
"
},
"RegisteredId": "string
",
"Rfc822Name": "string
",
"UniformResourceIdentifier": "string
"
},
"AccessMethod": {
"AccessMethodType": "string
",
"CustomObjectIdentifier": "string
"
}
}
]
},
"KeyAlgorithm": "string
",
"SigningAlgorithm": "string
",
"Subject": {
"CommonName": "string
",
"Country": "string
",
"CustomAttributes": [
{
"ObjectIdentifier": "string
",
"Value": "string
"
}
],
"DistinguishedNameQualifier": "string
",
"GenerationQualifier": "string
",
"GivenName": "string
",
"Initials": "string
",
"Locality": "string
",
"Organization": "string
",
"OrganizationalUnit": "string
",
"Pseudonym": "string
",
"SerialNumber": "string
",
"State": "string
",
"Surname": "string
",
"Title": "string
"
}
},
"CertificateAuthorityType": "string
",
"IdempotencyToken": "string
",
"KeyStorageSecurityStandard": "string
",
"RevocationConfiguration": {
"CrlConfiguration": {
"CrlDistributionPointExtensionConfiguration": {
"OmitExtension": boolean
},
"CustomCname": "string
",
"Enabled": boolean
,
"ExpirationInDays": number
,
"S3BucketName": "string
",
"S3ObjectAcl": "string
"
},
"OcspConfiguration": {
"Enabled": boolean
,
"OcspCustomCname": "string
"
}
},
"Tags": [
{
"Key": "string
",
"Value": "string
"
}
],
"UsageMode": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- CertificateAuthorityConfiguration
-
Name and bit size of the private key algorithm, the name of the signing algorithm, and X.500 certificate subject information.
Type: CertificateAuthorityConfiguration object
Required: Yes
- CertificateAuthorityType
-
The type of the certificate authority.
Type: String
Valid Values:
ROOT | SUBORDINATE
Required: Yes
- IdempotencyToken
-
Custom string that can be used to distinguish between calls to the CreateCertificateAuthority action. Idempotency tokens for CreateCertificateAuthority time out after five minutes. Therefore, if you call CreateCertificateAuthority multiple times with the same idempotency token within five minutes, AWS Private CA recognizes that you are requesting only certificate authority and will issue only one. If you change the idempotency token for each call, AWS Private CA recognizes that you are requesting multiple certificate authorities.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 36.
Pattern:
[\u0009\u000A\u000D\u0020-\u00FF]*
Required: No
- KeyStorageSecurityStandard
-
Specifies a cryptographic key management compliance standard used for handling CA keys.
Default: FIPS_140_2_LEVEL_3_OR_HIGHER
Note
Some AWS Regions do not support the default. When creating a CA in these Regions, you must provide
FIPS_140_2_LEVEL_2_OR_HIGHER
as the argument forKeyStorageSecurityStandard
. Failure to do this results in anInvalidArgsException
with the message, "A certificate authority cannot be created in this region with the specified security standard."For information about security standard support in various Regions, see Storage and security compliance of AWS Private CA private keys.
Type: String
Valid Values:
FIPS_140_2_LEVEL_2_OR_HIGHER | FIPS_140_2_LEVEL_3_OR_HIGHER | CCPC_LEVEL_1_OR_HIGHER
Required: No
- RevocationConfiguration
-
Contains information to enable support for Online Certificate Status Protocol (OCSP), certificate revocation list (CRL), both protocols, or neither. By default, both certificate validation mechanisms are disabled.
The following requirements apply to revocation configurations.
-
A configuration disabling CRLs or OCSP must contain only the
Enabled=False
parameter, and will fail if other parameters such asCustomCname
orExpirationInDays
are included. -
In a CRL configuration, the
S3BucketName
parameter must conform to Amazon S3 bucket naming rules. -
A configuration containing a custom Canonical Name (CNAME) parameter for CRLs or OCSP must conform to RFC2396
restrictions on the use of special characters in a CNAME. -
In a CRL or OCSP configuration, the value of a CNAME parameter must not include a protocol prefix such as "http://" or "https://".
For more information, see the OcspConfiguration and CrlConfiguration types.
Type: RevocationConfiguration object
Required: No
-
- Tags
-
Key-value pairs that will be attached to the new private CA. You can associate up to 50 tags with a private CA. For information using tags with IAM to manage permissions, see Controlling Access Using IAM Tags.
Type: Array of Tag objects
Array Members: Minimum number of 1 item. Maximum number of 50 items.
Required: No
- UsageMode
-
Specifies whether the CA issues general-purpose certificates that typically require a revocation mechanism, or short-lived certificates that may optionally omit revocation because they expire quickly. Short-lived certificate validity is limited to seven days.
The default value is GENERAL_PURPOSE.
Type: String
Valid Values:
GENERAL_PURPOSE | SHORT_LIVED_CERTIFICATE
Required: No
Response Syntax
{
"CertificateAuthorityArn": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- CertificateAuthorityArn
-
If successful, the Amazon Resource Name (ARN) of the certificate authority (CA). This is of the form:
arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
.Type: String
Length Constraints: Minimum length of 5. Maximum length of 200.
Pattern:
arn:[\w+=/,.@-]+:acm-pca:[\w+=/,.@-]*:[0-9]*:[\w+=,.@-]+(/[\w+=,.@-]+)*
Errors
For information about the errors that are common to all actions, see Common Errors.
- InvalidArgsException
-
One or more of the specified arguments was not valid.
HTTP Status Code: 400
- InvalidPolicyException
-
The resource policy is invalid or is missing a required statement. For general information about IAM policy and statement structure, see Overview of JSON Policies.
HTTP Status Code: 400
- InvalidTagException
-
The tag associated with the CA is not valid. The invalid argument is contained in the message field.
HTTP Status Code: 400
- LimitExceededException
-
An AWS Private CA quota has been exceeded. See the exception message returned to determine the quota that was exceeded.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of CreateCertificateAuthority.
Sample Request
POST / HTTP/1.1
Host: acm-pca.amazonaws.com
Accept-Encoding: identity
Content-Length: 512
X-Amz-Target: ACMPrivateCA.CreateCertificateAuthority
X-Amz-Date: 20210310T165448Z
User-Agent: aws-cli/1.15.4 Python/2.7.9 Windows/8 botocore/1.10.4
Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AWS_Access_Key_ID/20180515/AWS_Region/acm-pca/aws4_request,
SignedHeaders=content-type;host;x-amz-date;x-amz-target,
Signature=6fc58aaf789659cb4e0dd0ba484a2562d982b6b8edd56ea0c5c94c2af9aeafbe
{
"IdempotencyToken":"98256344",
"CertificateAuthorityConfiguration":{
"KeyAlgorithm":"RSA_2048",
"SigningAlgorithm":"SHA256WITHRSA",
"Subject":{
"Locality":"Seattle",
"Country":"US",
"CommonName":"www.example.com",
"State":"WA",
"Organization":"Example Ltd.",
"OrganizationalUnit":"Corporate"
}
},
"CertificateAuthorityType":"SUBORDINATE",
"RevocationConfiguration":{
"CrlConfiguration":{
"CustomCname":"CRL",
"Enabled":true,
"ExpirationInDays":7,
"S3BucketName":"amzn-s3-demo-bucket"
},
"OcspConfiguration":{
"Enabled":false
}
}
}
Example
This example illustrates one usage of CreateCertificateAuthority.
Sample Response
HTTP/1.1 200 OK
Date: Tue, 10 March 2021 16:54:56 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 127
x-amzn-RequestId: eacb346a-d80b-4be6-a1b2-1732c3ae3c38
Connection: keep-alive
{
"CertificateAuthorityArn": "arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012"
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: