package ink.wgink.module.wechat.pay.pojo.v3.certificates;

/**
 * @ClassName: Certificates
 * @Description: 平台证书
 * @Author: wanggeng
 * @Date: 2021/8/26 2:19 下午
 * @Version: 1.0
 */
public class Certificate {

    private String serialNo;
    private String effectiveTime;
    private String expireTime;
    private EncryptCertificate encryptCertificate;

    public String getSerialNo() {
        return serialNo == null ? "" : serialNo.trim();
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getEffectiveTime() {
        return effectiveTime == null ? "" : effectiveTime.trim();
    }

    public void setEffectiveTime(String effectiveTime) {
        this.effectiveTime = effectiveTime;
    }

    public String getExpireTime() {
        return expireTime == null ? "" : expireTime.trim();
    }

    public void setExpireTime(String expireTime) {
        this.expireTime = expireTime;
    }

    public EncryptCertificate getEncryptCertificate() {
        return encryptCertificate;
    }

    public void setEncryptCertificate(EncryptCertificate encryptCertificate) {
        this.encryptCertificate = encryptCertificate;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"serialNo\":\"")
                .append(serialNo).append('\"');
        sb.append(",\"effectiveTime\":\"")
                .append(effectiveTime).append('\"');
        sb.append(",\"expireTime\":\"")
                .append(expireTime).append('\"');
        sb.append(",\"encryptCertificate\":")
                .append(encryptCertificate);
        sb.append('}');
        return sb.toString();
    }

    public static class EncryptCertificate {
        private String algorithm;
        private String nonce;
        private String associatedData;
        private String ciphertext;

        public String getAlgorithm() {
            return algorithm == null ? "" : algorithm.trim();
        }

        public void setAlgorithm(String algorithm) {
            this.algorithm = algorithm;
        }

        public String getNonce() {
            return nonce == null ? "" : nonce.trim();
        }

        public void setNonce(String nonce) {
            this.nonce = nonce;
        }

        public String getAssociatedData() {
            return associatedData == null ? "" : associatedData.trim();
        }

        public void setAssociatedData(String associatedData) {
            this.associatedData = associatedData;
        }

        public String getCiphertext() {
            return ciphertext == null ? "" : ciphertext.trim();
        }

        public void setCiphertext(String ciphertext) {
            this.ciphertext = ciphertext;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("{");
            sb.append("\"algorithm\":\"")
                    .append(algorithm).append('\"');
            sb.append(",\"nonce\":\"")
                    .append(nonce).append('\"');
            sb.append(",\"associatedData\":\"")
                    .append(associatedData).append('\"');
            sb.append(",\"ciphertext\":\"")
                    .append(ciphertext).append('\"');
            sb.append('}');
            return sb.toString();
        }
    }

}
