com.huaweicloud.sdk.ccm.v1.model.IssueCertificateAuthorityCertificateRequestBody Maven / Gradle / Ivy
package com.huaweicloud.sdk.ccm.v1.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
/**
* IssueCertificateAuthorityCertificateRequestBody
*/
public class IssueCertificateAuthorityCertificateRequestBody {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "issuer_id")
private String issuerId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "path_length")
private Integer pathLength;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "signature_algorithm")
private String signatureAlgorithm;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "validity")
private Validity validity;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "type")
private String type;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "distinguished_name")
private DistinguishedName distinguishedName;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "key_algorithm")
private String keyAlgorithm;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "key_usages")
private List keyUsages = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "crl_configuration")
private CrlConfiguration crlConfiguration;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "enterprise_project_id")
private String enterpriseProjectId;
public IssueCertificateAuthorityCertificateRequestBody withIssuerId(String issuerId) {
this.issuerId = issuerId;
return this;
}
/**
* 父CA证书ID。
* @return issuerId
*/
public String getIssuerId() {
return issuerId;
}
public void setIssuerId(String issuerId) {
this.issuerId = issuerId;
}
public IssueCertificateAuthorityCertificateRequestBody withPathLength(Integer pathLength) {
this.pathLength = pathLength;
return this;
}
/**
* 路径长度。
* minimum: 0
* maximum: 6
* @return pathLength
*/
public Integer getPathLength() {
return pathLength;
}
public void setPathLength(Integer pathLength) {
this.pathLength = pathLength;
}
public IssueCertificateAuthorityCertificateRequestBody withSignatureAlgorithm(String signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
return this;
}
/**
* 签名哈希算法,可选值如下: - **SHA256** - **SHA384** - **SHA512** - **SM3**(中国站)
* @return signatureAlgorithm
*/
public String getSignatureAlgorithm() {
return signatureAlgorithm;
}
public void setSignatureAlgorithm(String signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
}
public IssueCertificateAuthorityCertificateRequestBody withValidity(Validity validity) {
this.validity = validity;
return this;
}
public IssueCertificateAuthorityCertificateRequestBody withValidity(Consumer validitySetter) {
if (this.validity == null) {
this.validity = new Validity();
validitySetter.accept(this.validity);
}
return this;
}
/**
* Get validity
* @return validity
*/
public Validity getValidity() {
return validity;
}
public void setValidity(Validity validity) {
this.validity = validity;
}
public IssueCertificateAuthorityCertificateRequestBody withType(String type) {
this.type = type;
return this;
}
/**
* 创建的CA类型。(如果激活包周期CA,为必填值) - **ROOT** : 根CA - **SUBORDINATE** : 从属CA
* @return type
*/
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public IssueCertificateAuthorityCertificateRequestBody withDistinguishedName(DistinguishedName distinguishedName) {
this.distinguishedName = distinguishedName;
return this;
}
public IssueCertificateAuthorityCertificateRequestBody withDistinguishedName(
Consumer distinguishedNameSetter) {
if (this.distinguishedName == null) {
this.distinguishedName = new DistinguishedName();
distinguishedNameSetter.accept(this.distinguishedName);
}
return this;
}
/**
* Get distinguishedName
* @return distinguishedName
*/
public DistinguishedName getDistinguishedName() {
return distinguishedName;
}
public void setDistinguishedName(DistinguishedName distinguishedName) {
this.distinguishedName = distinguishedName;
}
public IssueCertificateAuthorityCertificateRequestBody withKeyAlgorithm(String keyAlgorithm) {
this.keyAlgorithm = keyAlgorithm;
return this;
}
/**
* 密钥算法(如果激活包周期CA,为必填值),可选值如下: - **RSA2048** : RSA算法,密钥长度2048位; - **RSA4096** : RSA算法,密钥长度4096位; - **EC256** : 椭圆曲线算法(Elliptic Curve Digital Signature Algorithm (ECDSA)),密钥长度256位; - **EC384** : 椭圆曲线算法(Elliptic Curve Digital Signature Algorithm (ECDSA)),密钥长度384位; - **SM2** : 国家密码管理局颁发的椭圆曲线算法(签名哈希算法SM3),密钥长度256位。(中国站)
* @return keyAlgorithm
*/
public String getKeyAlgorithm() {
return keyAlgorithm;
}
public void setKeyAlgorithm(String keyAlgorithm) {
this.keyAlgorithm = keyAlgorithm;
}
public IssueCertificateAuthorityCertificateRequestBody withKeyUsages(List keyUsages) {
this.keyUsages = keyUsages;
return this;
}
public IssueCertificateAuthorityCertificateRequestBody addKeyUsagesItem(String keyUsagesItem) {
if (this.keyUsages == null) {
this.keyUsages = new ArrayList<>();
}
this.keyUsages.add(keyUsagesItem);
return this;
}
public IssueCertificateAuthorityCertificateRequestBody withKeyUsages(Consumer> keyUsagesSetter) {
if (this.keyUsages == null) {
this.keyUsages = new ArrayList<>();
}
keyUsagesSetter.accept(this.keyUsages);
return this;
}
/**
* 密钥用法,具体标准参见RFC 5280中:[4.2.1.3节](https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.3)。 - **digitalSignature** : 数字签名; - **nonRepudiation** : 不可抵赖; - **keyEncipherment** : 密钥用于加密密钥数据; - **dataEncipherment** : 用于加密数据; - **keyAgreement** : 密钥协商; - **keyCertSign** : 签发证书; - **cRLSign** : 签发吊销列表; - **encipherOnly** : 仅用于加密; - **decipherOnly** : 仅用于解密。 > 缺省值如下: > - 根CA证书:默认为**[digitalSignature,keyCertSign,cRLSign]**,忽略用户传入值; > - 从属CA证书:默认为**[digitalSignature,keyCertSign,cRLSign]**,支持用户自定义。
* @return keyUsages
*/
public List getKeyUsages() {
return keyUsages;
}
public void setKeyUsages(List keyUsages) {
this.keyUsages = keyUsages;
}
public IssueCertificateAuthorityCertificateRequestBody withCrlConfiguration(CrlConfiguration crlConfiguration) {
this.crlConfiguration = crlConfiguration;
return this;
}
public IssueCertificateAuthorityCertificateRequestBody withCrlConfiguration(
Consumer crlConfigurationSetter) {
if (this.crlConfiguration == null) {
this.crlConfiguration = new CrlConfiguration();
crlConfigurationSetter.accept(this.crlConfiguration);
}
return this;
}
/**
* Get crlConfiguration
* @return crlConfiguration
*/
public CrlConfiguration getCrlConfiguration() {
return crlConfiguration;
}
public void setCrlConfiguration(CrlConfiguration crlConfiguration) {
this.crlConfiguration = crlConfiguration;
}
public IssueCertificateAuthorityCertificateRequestBody withEnterpriseProjectId(String enterpriseProjectId) {
this.enterpriseProjectId = enterpriseProjectId;
return this;
}
/**
* 企业多项目ID。用户未开通企业多项目时,不需要输入该字段。 用户开通企业多项目时,查询资源可以输入该字段。 若用户不输入该字段,默认查询租户所有有权限的企业多项目下的资源。 此时“enterprise_project_id”取值为“all”。 若用户输入该字段,取值满足以下任一条件. 取值为“all” 取值为“0” 满足正则匹配:“^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$”
* @return enterpriseProjectId
*/
public String getEnterpriseProjectId() {
return enterpriseProjectId;
}
public void setEnterpriseProjectId(String enterpriseProjectId) {
this.enterpriseProjectId = enterpriseProjectId;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
IssueCertificateAuthorityCertificateRequestBody that = (IssueCertificateAuthorityCertificateRequestBody) obj;
return Objects.equals(this.issuerId, that.issuerId) && Objects.equals(this.pathLength, that.pathLength)
&& Objects.equals(this.signatureAlgorithm, that.signatureAlgorithm)
&& Objects.equals(this.validity, that.validity) && Objects.equals(this.type, that.type)
&& Objects.equals(this.distinguishedName, that.distinguishedName)
&& Objects.equals(this.keyAlgorithm, that.keyAlgorithm) && Objects.equals(this.keyUsages, that.keyUsages)
&& Objects.equals(this.crlConfiguration, that.crlConfiguration)
&& Objects.equals(this.enterpriseProjectId, that.enterpriseProjectId);
}
@Override
public int hashCode() {
return Objects.hash(issuerId,
pathLength,
signatureAlgorithm,
validity,
type,
distinguishedName,
keyAlgorithm,
keyUsages,
crlConfiguration,
enterpriseProjectId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class IssueCertificateAuthorityCertificateRequestBody {\n");
sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n");
sb.append(" pathLength: ").append(toIndentedString(pathLength)).append("\n");
sb.append(" signatureAlgorithm: ").append(toIndentedString(signatureAlgorithm)).append("\n");
sb.append(" validity: ").append(toIndentedString(validity)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" distinguishedName: ").append(toIndentedString(distinguishedName)).append("\n");
sb.append(" keyAlgorithm: ").append(toIndentedString(keyAlgorithm)).append("\n");
sb.append(" keyUsages: ").append(toIndentedString(keyUsages)).append("\n");
sb.append(" crlConfiguration: ").append(toIndentedString(crlConfiguration)).append("\n");
sb.append(" enterpriseProjectId: ").append(toIndentedString(enterpriseProjectId)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}