
commonMain.aws.sdk.kotlin.services.acmpca.model.KeyUsage.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.acmpca.model
/**
* Defines one or more purposes for which the key contained in the certificate can be used. Default value for each option is false.
*/
public class KeyUsage private constructor(builder: Builder) {
/**
* Key can be used to sign CRLs.
*/
public val crlSign: kotlin.Boolean = builder.crlSign
/**
* Key can be used to decipher data.
*/
public val dataEncipherment: kotlin.Boolean = builder.dataEncipherment
/**
* Key can be used only to decipher data.
*/
public val decipherOnly: kotlin.Boolean = builder.decipherOnly
/**
* Key can be used for digital signing.
*/
public val digitalSignature: kotlin.Boolean = builder.digitalSignature
/**
* Key can be used only to encipher data.
*/
public val encipherOnly: kotlin.Boolean = builder.encipherOnly
/**
* Key can be used in a key-agreement protocol.
*/
public val keyAgreement: kotlin.Boolean = builder.keyAgreement
/**
* Key can be used to sign certificates.
*/
public val keyCertSign: kotlin.Boolean = builder.keyCertSign
/**
* Key can be used to encipher data.
*/
public val keyEncipherment: kotlin.Boolean = builder.keyEncipherment
/**
* Key can be used for non-repudiation.
*/
public val nonRepudiation: kotlin.Boolean = builder.nonRepudiation
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.acmpca.model.KeyUsage = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("KeyUsage(")
append("crlSign=$crlSign,")
append("dataEncipherment=$dataEncipherment,")
append("decipherOnly=$decipherOnly,")
append("digitalSignature=$digitalSignature,")
append("encipherOnly=$encipherOnly,")
append("keyAgreement=$keyAgreement,")
append("keyCertSign=$keyCertSign,")
append("keyEncipherment=$keyEncipherment,")
append("nonRepudiation=$nonRepudiation")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = crlSign.hashCode()
result = 31 * result + (dataEncipherment.hashCode())
result = 31 * result + (decipherOnly.hashCode())
result = 31 * result + (digitalSignature.hashCode())
result = 31 * result + (encipherOnly.hashCode())
result = 31 * result + (keyAgreement.hashCode())
result = 31 * result + (keyCertSign.hashCode())
result = 31 * result + (keyEncipherment.hashCode())
result = 31 * result + (nonRepudiation.hashCode())
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 KeyUsage
if (crlSign != other.crlSign) return false
if (dataEncipherment != other.dataEncipherment) return false
if (decipherOnly != other.decipherOnly) return false
if (digitalSignature != other.digitalSignature) return false
if (encipherOnly != other.encipherOnly) return false
if (keyAgreement != other.keyAgreement) return false
if (keyCertSign != other.keyCertSign) return false
if (keyEncipherment != other.keyEncipherment) return false
if (nonRepudiation != other.nonRepudiation) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.acmpca.model.KeyUsage = Builder(this).apply(block).build()
public class Builder {
/**
* Key can be used to sign CRLs.
*/
public var crlSign: kotlin.Boolean = false
/**
* Key can be used to decipher data.
*/
public var dataEncipherment: kotlin.Boolean = false
/**
* Key can be used only to decipher data.
*/
public var decipherOnly: kotlin.Boolean = false
/**
* Key can be used for digital signing.
*/
public var digitalSignature: kotlin.Boolean = false
/**
* Key can be used only to encipher data.
*/
public var encipherOnly: kotlin.Boolean = false
/**
* Key can be used in a key-agreement protocol.
*/
public var keyAgreement: kotlin.Boolean = false
/**
* Key can be used to sign certificates.
*/
public var keyCertSign: kotlin.Boolean = false
/**
* Key can be used to encipher data.
*/
public var keyEncipherment: kotlin.Boolean = false
/**
* Key can be used for non-repudiation.
*/
public var nonRepudiation: kotlin.Boolean = false
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.acmpca.model.KeyUsage) : this() {
this.crlSign = x.crlSign
this.dataEncipherment = x.dataEncipherment
this.decipherOnly = x.decipherOnly
this.digitalSignature = x.digitalSignature
this.encipherOnly = x.encipherOnly
this.keyAgreement = x.keyAgreement
this.keyCertSign = x.keyCertSign
this.keyEncipherment = x.keyEncipherment
this.nonRepudiation = x.nonRepudiation
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.acmpca.model.KeyUsage = KeyUsage(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy