All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.acmpca.model.CertificateAuthority.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.acmpca.model

import aws.smithy.kotlin.runtime.time.Instant

/**
 * Contains information about your private certificate authority (CA). Your private CA can issue and revoke X.509 digital certificates. Digital certificates verify that the entity named in the certificate **Subject** field owns or controls the public key contained in the **Subject Public Key Info** field. Call the [CreateCertificateAuthority](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html) action to create your private CA. You must then call the [GetCertificateAuthorityCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_GetCertificateAuthorityCertificate.html) action to retrieve a private CA certificate signing request (CSR). Sign the CSR with your Amazon Web Services Private CA-hosted or on-premises root or subordinate CA certificate. Call the [ImportCertificateAuthorityCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html) action to import the signed certificate into Certificate Manager (ACM).
 */
public class CertificateAuthority private constructor(builder: Builder) {
    /**
     * Amazon Resource Name (ARN) for your private certificate authority (CA). The format is ` 12345678-1234-1234-1234-123456789012 `.
     */
    public val arn: kotlin.String? = builder.arn
    /**
     * Your private CA configuration.
     */
    public val certificateAuthorityConfiguration: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityConfiguration? = builder.certificateAuthorityConfiguration
    /**
     * Date and time at which your private CA was created.
     */
    public val createdAt: aws.smithy.kotlin.runtime.time.Instant? = builder.createdAt
    /**
     * Reason the request to create your private CA failed.
     */
    public val failureReason: aws.sdk.kotlin.services.acmpca.model.FailureReason? = builder.failureReason
    /**
     * Defines a cryptographic key management compliance standard used for handling CA keys.
     *
     * Default: FIPS_140_2_LEVEL_3_OR_HIGHER
     *
     * Note: Amazon Web Services Region ap-northeast-3 supports only FIPS_140_2_LEVEL_2_OR_HIGHER. You must explicitly specify this parameter and value when creating a CA in that Region. Specifying a different value (or no value) results in an `InvalidArgsException` with the message "A certificate authority cannot be created in this region with the specified security standard."
     */
    public val keyStorageSecurityStandard: aws.sdk.kotlin.services.acmpca.model.KeyStorageSecurityStandard? = builder.keyStorageSecurityStandard
    /**
     * Date and time at which your private CA was last updated.
     */
    public val lastStateChangeAt: aws.smithy.kotlin.runtime.time.Instant? = builder.lastStateChangeAt
    /**
     * Date and time after which your private CA certificate is not valid.
     */
    public val notAfter: aws.smithy.kotlin.runtime.time.Instant? = builder.notAfter
    /**
     * Date and time before which your private CA certificate is not valid.
     */
    public val notBefore: aws.smithy.kotlin.runtime.time.Instant? = builder.notBefore
    /**
     * The Amazon Web Services account ID that owns the certificate authority.
     */
    public val ownerAccount: kotlin.String? = builder.ownerAccount
    /**
     * The period during which a deleted CA can be restored. For more information, see the `PermanentDeletionTimeInDays` parameter of the [DeleteCertificateAuthorityRequest](https://docs.aws.amazon.com/privateca/latest/APIReference/API_DeleteCertificateAuthorityRequest.html) action.
     */
    public val restorableUntil: aws.smithy.kotlin.runtime.time.Instant? = builder.restorableUntil
    /**
     * Information about the Online Certificate Status Protocol (OCSP) configuration or certificate revocation list (CRL) created and maintained by your private CA.
     */
    public val revocationConfiguration: aws.sdk.kotlin.services.acmpca.model.RevocationConfiguration? = builder.revocationConfiguration
    /**
     * Serial number of your private CA.
     */
    public val serial: kotlin.String? = builder.serial
    /**
     * Status of your private CA.
     */
    public val status: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityStatus? = builder.status
    /**
     * Type of your private CA.
     */
    public val type: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityType? = builder.type
    /**
     * 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.
     */
    public val usageMode: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityUsageMode? = builder.usageMode

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.acmpca.model.CertificateAuthority = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("CertificateAuthority(")
        append("arn=$arn,")
        append("certificateAuthorityConfiguration=$certificateAuthorityConfiguration,")
        append("createdAt=$createdAt,")
        append("failureReason=$failureReason,")
        append("keyStorageSecurityStandard=$keyStorageSecurityStandard,")
        append("lastStateChangeAt=$lastStateChangeAt,")
        append("notAfter=$notAfter,")
        append("notBefore=$notBefore,")
        append("ownerAccount=$ownerAccount,")
        append("restorableUntil=$restorableUntil,")
        append("revocationConfiguration=$revocationConfiguration,")
        append("serial=$serial,")
        append("status=$status,")
        append("type=$type,")
        append("usageMode=$usageMode")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = arn?.hashCode() ?: 0
        result = 31 * result + (certificateAuthorityConfiguration?.hashCode() ?: 0)
        result = 31 * result + (createdAt?.hashCode() ?: 0)
        result = 31 * result + (failureReason?.hashCode() ?: 0)
        result = 31 * result + (keyStorageSecurityStandard?.hashCode() ?: 0)
        result = 31 * result + (lastStateChangeAt?.hashCode() ?: 0)
        result = 31 * result + (notAfter?.hashCode() ?: 0)
        result = 31 * result + (notBefore?.hashCode() ?: 0)
        result = 31 * result + (ownerAccount?.hashCode() ?: 0)
        result = 31 * result + (restorableUntil?.hashCode() ?: 0)
        result = 31 * result + (revocationConfiguration?.hashCode() ?: 0)
        result = 31 * result + (serial?.hashCode() ?: 0)
        result = 31 * result + (status?.hashCode() ?: 0)
        result = 31 * result + (type?.hashCode() ?: 0)
        result = 31 * result + (usageMode?.hashCode() ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as CertificateAuthority

        if (arn != other.arn) return false
        if (certificateAuthorityConfiguration != other.certificateAuthorityConfiguration) return false
        if (createdAt != other.createdAt) return false
        if (failureReason != other.failureReason) return false
        if (keyStorageSecurityStandard != other.keyStorageSecurityStandard) return false
        if (lastStateChangeAt != other.lastStateChangeAt) return false
        if (notAfter != other.notAfter) return false
        if (notBefore != other.notBefore) return false
        if (ownerAccount != other.ownerAccount) return false
        if (restorableUntil != other.restorableUntil) return false
        if (revocationConfiguration != other.revocationConfiguration) return false
        if (serial != other.serial) return false
        if (status != other.status) return false
        if (type != other.type) return false
        if (usageMode != other.usageMode) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.acmpca.model.CertificateAuthority = Builder(this).apply(block).build()

    public class Builder {
        /**
         * Amazon Resource Name (ARN) for your private certificate authority (CA). The format is ` 12345678-1234-1234-1234-123456789012 `.
         */
        public var arn: kotlin.String? = null
        /**
         * Your private CA configuration.
         */
        public var certificateAuthorityConfiguration: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityConfiguration? = null
        /**
         * Date and time at which your private CA was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Reason the request to create your private CA failed.
         */
        public var failureReason: aws.sdk.kotlin.services.acmpca.model.FailureReason? = null
        /**
         * Defines a cryptographic key management compliance standard used for handling CA keys.
         *
         * Default: FIPS_140_2_LEVEL_3_OR_HIGHER
         *
         * Note: Amazon Web Services Region ap-northeast-3 supports only FIPS_140_2_LEVEL_2_OR_HIGHER. You must explicitly specify this parameter and value when creating a CA in that Region. Specifying a different value (or no value) results in an `InvalidArgsException` with the message "A certificate authority cannot be created in this region with the specified security standard."
         */
        public var keyStorageSecurityStandard: aws.sdk.kotlin.services.acmpca.model.KeyStorageSecurityStandard? = null
        /**
         * Date and time at which your private CA was last updated.
         */
        public var lastStateChangeAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Date and time after which your private CA certificate is not valid.
         */
        public var notAfter: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Date and time before which your private CA certificate is not valid.
         */
        public var notBefore: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The Amazon Web Services account ID that owns the certificate authority.
         */
        public var ownerAccount: kotlin.String? = null
        /**
         * The period during which a deleted CA can be restored. For more information, see the `PermanentDeletionTimeInDays` parameter of the [DeleteCertificateAuthorityRequest](https://docs.aws.amazon.com/privateca/latest/APIReference/API_DeleteCertificateAuthorityRequest.html) action.
         */
        public var restorableUntil: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Information about the Online Certificate Status Protocol (OCSP) configuration or certificate revocation list (CRL) created and maintained by your private CA.
         */
        public var revocationConfiguration: aws.sdk.kotlin.services.acmpca.model.RevocationConfiguration? = null
        /**
         * Serial number of your private CA.
         */
        public var serial: kotlin.String? = null
        /**
         * Status of your private CA.
         */
        public var status: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityStatus? = null
        /**
         * Type of your private CA.
         */
        public var type: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityType? = null
        /**
         * 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.
         */
        public var usageMode: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityUsageMode? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.acmpca.model.CertificateAuthority) : this() {
            this.arn = x.arn
            this.certificateAuthorityConfiguration = x.certificateAuthorityConfiguration
            this.createdAt = x.createdAt
            this.failureReason = x.failureReason
            this.keyStorageSecurityStandard = x.keyStorageSecurityStandard
            this.lastStateChangeAt = x.lastStateChangeAt
            this.notAfter = x.notAfter
            this.notBefore = x.notBefore
            this.ownerAccount = x.ownerAccount
            this.restorableUntil = x.restorableUntil
            this.revocationConfiguration = x.revocationConfiguration
            this.serial = x.serial
            this.status = x.status
            this.type = x.type
            this.usageMode = x.usageMode
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.acmpca.model.CertificateAuthority = CertificateAuthority(this)

        /**
         * construct an [aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityConfiguration] inside the given [block]
         */
        public fun certificateAuthorityConfiguration(block: aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityConfiguration.Builder.() -> kotlin.Unit) {
            this.certificateAuthorityConfiguration = aws.sdk.kotlin.services.acmpca.model.CertificateAuthorityConfiguration.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.acmpca.model.RevocationConfiguration] inside the given [block]
         */
        public fun revocationConfiguration(block: aws.sdk.kotlin.services.acmpca.model.RevocationConfiguration.Builder.() -> kotlin.Unit) {
            this.revocationConfiguration = aws.sdk.kotlin.services.acmpca.model.RevocationConfiguration.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy