package com.ruoyi.security.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 加密密钥对象 dc_encryption_key
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
public class EncryptionKey extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 密钥ID */
    private Long keyId;

    /** 密钥标识符 */
    @Excel(name = "密钥标识符")
    private String keyIdentifier;

    /** 密钥版本 */
    @Excel(name = "密钥版本")
    private Integer keyVersion;

    /** 加密算法 */
    @Excel(name = "加密算法")
    private String algorithm;

    /** 密钥长度 */
    @Excel(name = "密钥长度")
    private Integer keyLength;

    /** 密钥状态 */
    @Excel(name = "密钥状态")
    private String keyStatus;

    /** 密钥用途 */
    @Excel(name = "密钥用途")
    private String keyUsage;

    /** HSM密钥句柄 */
    @Excel(name = "HSM密钥句柄")
    private String hsmKeyHandle;

    /** 密钥创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "密钥创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date keyCreatedTime;

    /** 密钥过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "密钥过期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date keyExpiryTime;

    /** 最后使用时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后使用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastUsedTime;

    /** 使用次数 */
    @Excel(name = "使用次数")
    private Long usageCount;

    /** 是否为主密钥 */
    @Excel(name = "是否为主密钥")
    private Integer isPrimary;

    public void setKeyId(Long keyId) 
    {
        this.keyId = keyId;
    }

    public Long getKeyId() 
    {
        return keyId;
    }
    public void setKeyIdentifier(String keyIdentifier) 
    {
        this.keyIdentifier = keyIdentifier;
    }

    public String getKeyIdentifier() 
    {
        return keyIdentifier;
    }
    public void setKeyVersion(Integer keyVersion) 
    {
        this.keyVersion = keyVersion;
    }

    public Integer getKeyVersion() 
    {
        return keyVersion;
    }
    public void setAlgorithm(String algorithm) 
    {
        this.algorithm = algorithm;
    }

    public String getAlgorithm() 
    {
        return algorithm;
    }
    public void setKeyLength(Integer keyLength) 
    {
        this.keyLength = keyLength;
    }

    public Integer getKeyLength() 
    {
        return keyLength;
    }
    public void setKeyStatus(String keyStatus) 
    {
        this.keyStatus = keyStatus;
    }

    public String getKeyStatus() 
    {
        return keyStatus;
    }
    public void setKeyUsage(String keyUsage) 
    {
        this.keyUsage = keyUsage;
    }

    public String getKeyUsage() 
    {
        return keyUsage;
    }
    public void setHsmKeyHandle(String hsmKeyHandle) 
    {
        this.hsmKeyHandle = hsmKeyHandle;
    }

    public String getHsmKeyHandle() 
    {
        return hsmKeyHandle;
    }
    public void setKeyCreatedTime(Date keyCreatedTime) 
    {
        this.keyCreatedTime = keyCreatedTime;
    }

    public Date getKeyCreatedTime() 
    {
        return keyCreatedTime;
    }
    public void setKeyExpiryTime(Date keyExpiryTime) 
    {
        this.keyExpiryTime = keyExpiryTime;
    }

    public Date getKeyExpiryTime() 
    {
        return keyExpiryTime;
    }
    public void setLastUsedTime(Date lastUsedTime) 
    {
        this.lastUsedTime = lastUsedTime;
    }

    public Date getLastUsedTime() 
    {
        return lastUsedTime;
    }
    public void setUsageCount(Long usageCount) 
    {
        this.usageCount = usageCount;
    }

    public Long getUsageCount() 
    {
        return usageCount;
    }
    public void setIsPrimary(Integer isPrimary) 
    {
        this.isPrimary = isPrimary;
    }

    public Integer getIsPrimary() 
    {
        return isPrimary;
    }

    @Override
    public String toString() {
        return "EncryptionKey{" +
                "keyId=" + keyId +
                ", keyIdentifier='" + keyIdentifier + '\'' +
                ", keyVersion=" + keyVersion +
                ", algorithm='" + algorithm + '\'' +
                ", keyLength=" + keyLength +
                ", keyStatus='" + keyStatus + '\'' +
                ", keyUsage='" + keyUsage + '\'' +
                ", hsmKeyHandle='" + hsmKeyHandle + '\'' +
                ", keyCreatedTime=" + keyCreatedTime +
                ", keyExpiryTime=" + keyExpiryTime +
                ", lastUsedTime=" + lastUsedTime +
                ", usageCount=" + usageCount +
                ", isPrimary=" + isPrimary +
                '}';
    }
}