package com.iqser.red.service.persistence.management.v1.processor.entity.configuration;

import jakarta.persistence.Basic;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.Table;

import com.iqser.red.service.persistence.service.v1.api.shared.model.utils.SuppressFBWarnings;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "digital_signature_kms")
@SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE")
public class DigitalSignatureKmsEntity {

    public static final String ID = "CONFIG_ID";

    @Id
    private final String id = DigitalSignatureKmsEntity.ID;
    @Column
    private String certificateName;
    @Column
    private String kmsKeyId;
    @Column
    private String kmsServiceEndpoint;
    @Column
    private String kmsRegion;
    @Column
    private String kmsAccessKey;
    @Column
    private String kmsSecretKey;
    @Column
    @Lob
    @Basic(fetch= FetchType.EAGER)
    private byte[] certificate;

}
