/* * 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.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RevokeCertificateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form: *
*
* arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
*
* Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the serial * number by calling GetCertificate with * the Amazon Resource Name (ARN) of the certificate you want and the ARN of your private CA. The * GetCertificate action retrieves the certificate in the PEM format. You can use the following OpenSSL * command to list the certificate in text format and copy the hexadecimal serial number. *
*
* openssl x509 -in file_path -text -noout
*
* You can also copy the serial number from the console or use the DescribeCertificate * action in the Certificate Manager API Reference. *
*/ private String certificateSerial; /** ** Specifies why you revoked the certificate. *
*/ private String revocationReason; /** ** Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form: *
*
* arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
*
* arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
*/
public void setCertificateAuthorityArn(String certificateAuthorityArn) {
this.certificateAuthorityArn = certificateAuthorityArn;
}
/**
*
* Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form: *
*
* arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
*
* arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
*/
public String getCertificateAuthorityArn() {
return this.certificateAuthorityArn;
}
/**
*
* Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form: *
*
* arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
*
* arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RevokeCertificateRequest withCertificateAuthorityArn(String certificateAuthorityArn) {
setCertificateAuthorityArn(certificateAuthorityArn);
return this;
}
/**
*
* Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the serial * number by calling GetCertificate with * the Amazon Resource Name (ARN) of the certificate you want and the ARN of your private CA. The * GetCertificate action retrieves the certificate in the PEM format. You can use the following OpenSSL * command to list the certificate in text format and copy the hexadecimal serial number. *
*
* openssl x509 -in file_path -text -noout
*
* You can also copy the serial number from the console or use the DescribeCertificate * action in the Certificate Manager API Reference. *
* * @param certificateSerial * Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the * serial number by calling GetCertificate with the Amazon Resource Name (ARN) of the certificate you want and the ARN of your * private CA. The GetCertificate action retrieves the certificate in the PEM format. You can use the * following OpenSSL command to list the certificate in text format and copy the hexadecimal serial number. * *
* openssl x509 -in file_path -text -noout
*
* You can also copy the serial number from the console or use the DescribeCertificate action in the Certificate Manager API Reference. */ public void setCertificateSerial(String certificateSerial) { this.certificateSerial = certificateSerial; } /** *
* Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the serial * number by calling GetCertificate with * the Amazon Resource Name (ARN) of the certificate you want and the ARN of your private CA. The * GetCertificate action retrieves the certificate in the PEM format. You can use the following OpenSSL * command to list the certificate in text format and copy the hexadecimal serial number. *
*
* openssl x509 -in file_path -text -noout
*
* You can also copy the serial number from the console or use the DescribeCertificate * action in the Certificate Manager API Reference. *
* * @return Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the * serial number by calling GetCertificate with the Amazon Resource Name (ARN) of the certificate you want and the ARN of your * private CA. The GetCertificate action retrieves the certificate in the PEM format. You can use the * following OpenSSL command to list the certificate in text format and copy the hexadecimal serial number. * *
* openssl x509 -in file_path -text -noout
*
* You can also copy the serial number from the console or use the DescribeCertificate action in the Certificate Manager API Reference. */ public String getCertificateSerial() { return this.certificateSerial; } /** *
* Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the serial * number by calling GetCertificate with * the Amazon Resource Name (ARN) of the certificate you want and the ARN of your private CA. The * GetCertificate action retrieves the certificate in the PEM format. You can use the following OpenSSL * command to list the certificate in text format and copy the hexadecimal serial number. *
*
* openssl x509 -in file_path -text -noout
*
* You can also copy the serial number from the console or use the DescribeCertificate * action in the Certificate Manager API Reference. *
* * @param certificateSerial * Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the * serial number by calling GetCertificate with the Amazon Resource Name (ARN) of the certificate you want and the ARN of your * private CA. The GetCertificate action retrieves the certificate in the PEM format. You can use the * following OpenSSL command to list the certificate in text format and copy the hexadecimal serial number. * *
* openssl x509 -in file_path -text -noout
*
* You can also copy the serial number from the console or use the DescribeCertificate action in the Certificate Manager API Reference. * @return Returns a reference to this object so that method calls can be chained together. */ public RevokeCertificateRequest withCertificateSerial(String certificateSerial) { setCertificateSerial(certificateSerial); return this; } /** *
* Specifies why you revoked the certificate. *
* * @param revocationReason * Specifies why you revoked the certificate. * @see RevocationReason */ public void setRevocationReason(String revocationReason) { this.revocationReason = revocationReason; } /** ** Specifies why you revoked the certificate. *
* * @return Specifies why you revoked the certificate. * @see RevocationReason */ public String getRevocationReason() { return this.revocationReason; } /** ** Specifies why you revoked the certificate. *
* * @param revocationReason * Specifies why you revoked the certificate. * @return Returns a reference to this object so that method calls can be chained together. * @see RevocationReason */ public RevokeCertificateRequest withRevocationReason(String revocationReason) { setRevocationReason(revocationReason); return this; } /** ** Specifies why you revoked the certificate. *
* * @param revocationReason * Specifies why you revoked the certificate. * @return Returns a reference to this object so that method calls can be chained together. * @see RevocationReason */ public RevokeCertificateRequest withRevocationReason(RevocationReason revocationReason) { this.revocationReason = revocationReason.toString(); 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 (getCertificateAuthorityArn() != null) sb.append("CertificateAuthorityArn: ").append(getCertificateAuthorityArn()).append(","); if (getCertificateSerial() != null) sb.append("CertificateSerial: ").append(getCertificateSerial()).append(","); if (getRevocationReason() != null) sb.append("RevocationReason: ").append(getRevocationReason()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RevokeCertificateRequest == false) return false; RevokeCertificateRequest other = (RevokeCertificateRequest) obj; if (other.getCertificateAuthorityArn() == null ^ this.getCertificateAuthorityArn() == null) return false; if (other.getCertificateAuthorityArn() != null && other.getCertificateAuthorityArn().equals(this.getCertificateAuthorityArn()) == false) return false; if (other.getCertificateSerial() == null ^ this.getCertificateSerial() == null) return false; if (other.getCertificateSerial() != null && other.getCertificateSerial().equals(this.getCertificateSerial()) == false) return false; if (other.getRevocationReason() == null ^ this.getRevocationReason() == null) return false; if (other.getRevocationReason() != null && other.getRevocationReason().equals(this.getRevocationReason()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCertificateAuthorityArn() == null) ? 0 : getCertificateAuthorityArn().hashCode()); hashCode = prime * hashCode + ((getCertificateSerial() == null) ? 0 : getCertificateSerial().hashCode()); hashCode = prime * hashCode + ((getRevocationReason() == null) ? 0 : getRevocationReason().hashCode()); return hashCode; } @Override public RevokeCertificateRequest clone() { return (RevokeCertificateRequest) super.clone(); } }