/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.acmpca.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Contains configuration information for your private certificate authority (CA). This includes information about the * class of public key algorithm and the key pair that your private CA creates when it issues a certificate. It also * includes the signature algorithm that it uses when issuing certificates, and its X.500 distinguished name. You must * specify this information when you call the CreateCertificateAuthority action. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CertificateAuthorityConfiguration implements Serializable, Cloneable, StructuredPojo { /** *

* Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. *

*/ private String keyAlgorithm; /** *

* Name of the algorithm your private CA uses to sign certificate requests. *

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign certificates * when they are issued. *

*/ private String signingAlgorithm; /** *

* Structure that contains X.500 distinguished name information for your private CA. *

*/ private ASN1Subject subject; /** *

* Specifies information to be added to the extension section of the certificate signing request (CSR). *

*/ private CsrExtensions csrExtensions; /** *

* Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. *

* * @param keyAlgorithm * Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. * @see KeyAlgorithm */ public void setKeyAlgorithm(String keyAlgorithm) { this.keyAlgorithm = keyAlgorithm; } /** *

* Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. *

* * @return Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. * @see KeyAlgorithm */ public String getKeyAlgorithm() { return this.keyAlgorithm; } /** *

* Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. *

* * @param keyAlgorithm * Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. * @return Returns a reference to this object so that method calls can be chained together. * @see KeyAlgorithm */ public CertificateAuthorityConfiguration withKeyAlgorithm(String keyAlgorithm) { setKeyAlgorithm(keyAlgorithm); return this; } /** *

* Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. *

* * @param keyAlgorithm * Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a * certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA. * @return Returns a reference to this object so that method calls can be chained together. * @see KeyAlgorithm */ public CertificateAuthorityConfiguration withKeyAlgorithm(KeyAlgorithm keyAlgorithm) { this.keyAlgorithm = keyAlgorithm.toString(); return this; } /** *

* Name of the algorithm your private CA uses to sign certificate requests. *

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign certificates * when they are issued. *

* * @param signingAlgorithm * Name of the algorithm your private CA uses to sign certificate requests.

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign * certificates when they are issued. * @see SigningAlgorithm */ public void setSigningAlgorithm(String signingAlgorithm) { this.signingAlgorithm = signingAlgorithm; } /** *

* Name of the algorithm your private CA uses to sign certificate requests. *

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign certificates * when they are issued. *

* * @return Name of the algorithm your private CA uses to sign certificate requests.

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign * certificates when they are issued. * @see SigningAlgorithm */ public String getSigningAlgorithm() { return this.signingAlgorithm; } /** *

* Name of the algorithm your private CA uses to sign certificate requests. *

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign certificates * when they are issued. *

* * @param signingAlgorithm * Name of the algorithm your private CA uses to sign certificate requests.

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign * certificates when they are issued. * @return Returns a reference to this object so that method calls can be chained together. * @see SigningAlgorithm */ public CertificateAuthorityConfiguration withSigningAlgorithm(String signingAlgorithm) { setSigningAlgorithm(signingAlgorithm); return this; } /** *

* Name of the algorithm your private CA uses to sign certificate requests. *

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign certificates * when they are issued. *

* * @param signingAlgorithm * Name of the algorithm your private CA uses to sign certificate requests.

*

* This parameter should not be confused with the SigningAlgorithm parameter used to sign * certificates when they are issued. * @return Returns a reference to this object so that method calls can be chained together. * @see SigningAlgorithm */ public CertificateAuthorityConfiguration withSigningAlgorithm(SigningAlgorithm signingAlgorithm) { this.signingAlgorithm = signingAlgorithm.toString(); return this; } /** *

* Structure that contains X.500 distinguished name information for your private CA. *

* * @param subject * Structure that contains X.500 distinguished name information for your private CA. */ public void setSubject(ASN1Subject subject) { this.subject = subject; } /** *

* Structure that contains X.500 distinguished name information for your private CA. *

* * @return Structure that contains X.500 distinguished name information for your private CA. */ public ASN1Subject getSubject() { return this.subject; } /** *

* Structure that contains X.500 distinguished name information for your private CA. *

* * @param subject * Structure that contains X.500 distinguished name information for your private CA. * @return Returns a reference to this object so that method calls can be chained together. */ public CertificateAuthorityConfiguration withSubject(ASN1Subject subject) { setSubject(subject); return this; } /** *

* Specifies information to be added to the extension section of the certificate signing request (CSR). *

* * @param csrExtensions * Specifies information to be added to the extension section of the certificate signing request (CSR). */ public void setCsrExtensions(CsrExtensions csrExtensions) { this.csrExtensions = csrExtensions; } /** *

* Specifies information to be added to the extension section of the certificate signing request (CSR). *

* * @return Specifies information to be added to the extension section of the certificate signing request (CSR). */ public CsrExtensions getCsrExtensions() { return this.csrExtensions; } /** *

* Specifies information to be added to the extension section of the certificate signing request (CSR). *

* * @param csrExtensions * Specifies information to be added to the extension section of the certificate signing request (CSR). * @return Returns a reference to this object so that method calls can be chained together. */ public CertificateAuthorityConfiguration withCsrExtensions(CsrExtensions csrExtensions) { setCsrExtensions(csrExtensions); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getKeyAlgorithm() != null) sb.append("KeyAlgorithm: ").append(getKeyAlgorithm()).append(","); if (getSigningAlgorithm() != null) sb.append("SigningAlgorithm: ").append(getSigningAlgorithm()).append(","); if (getSubject() != null) sb.append("Subject: ").append(getSubject()).append(","); if (getCsrExtensions() != null) sb.append("CsrExtensions: ").append(getCsrExtensions()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CertificateAuthorityConfiguration == false) return false; CertificateAuthorityConfiguration other = (CertificateAuthorityConfiguration) obj; if (other.getKeyAlgorithm() == null ^ this.getKeyAlgorithm() == null) return false; if (other.getKeyAlgorithm() != null && other.getKeyAlgorithm().equals(this.getKeyAlgorithm()) == false) return false; if (other.getSigningAlgorithm() == null ^ this.getSigningAlgorithm() == null) return false; if (other.getSigningAlgorithm() != null && other.getSigningAlgorithm().equals(this.getSigningAlgorithm()) == false) return false; if (other.getSubject() == null ^ this.getSubject() == null) return false; if (other.getSubject() != null && other.getSubject().equals(this.getSubject()) == false) return false; if (other.getCsrExtensions() == null ^ this.getCsrExtensions() == null) return false; if (other.getCsrExtensions() != null && other.getCsrExtensions().equals(this.getCsrExtensions()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getKeyAlgorithm() == null) ? 0 : getKeyAlgorithm().hashCode()); hashCode = prime * hashCode + ((getSigningAlgorithm() == null) ? 0 : getSigningAlgorithm().hashCode()); hashCode = prime * hashCode + ((getSubject() == null) ? 0 : getSubject().hashCode()); hashCode = prime * hashCode + ((getCsrExtensions() == null) ? 0 : getCsrExtensions().hashCode()); return hashCode; } @Override public CertificateAuthorityConfiguration clone() { try { return (CertificateAuthorityConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.acmpca.model.transform.CertificateAuthorityConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }