55 lines
1.3 KiB
Java
55 lines
1.3 KiB
Java
package de.mlessmann.certassist.models;
|
|
|
|
import jakarta.persistence.*;
|
|
import jakarta.validation.constraints.Min;
|
|
import jakarta.validation.constraints.NotNull;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import lombok.AccessLevel;
|
|
import lombok.Data;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.Setter;
|
|
|
|
@Entity
|
|
@Data
|
|
@RequiredArgsConstructor
|
|
public class Certificate {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.UUID)
|
|
@Setter(AccessLevel.NONE)
|
|
private String id;
|
|
|
|
@NotNull
|
|
@Enumerated(EnumType.STRING)
|
|
private CertificateType type;
|
|
|
|
@NotNull
|
|
private String commonName;
|
|
|
|
private String trustingAuthority;
|
|
|
|
@Min(1)
|
|
private int requestedKeyLength;
|
|
|
|
@Min(1)
|
|
private int requestedValidityDays;
|
|
|
|
private String subjectEmailAddress;
|
|
private String subjectOrganization;
|
|
private String subjectOrganizationalUnit;
|
|
private String subjectCountry;
|
|
private String subjectState;
|
|
private String subjectLocality;
|
|
|
|
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
|
private List<CertificateExtension> certificateExtension = new ArrayList<>();
|
|
|
|
@Lob
|
|
private byte[] cert = new byte[0];
|
|
|
|
@Lob
|
|
private byte[] privateKey = new byte[0];
|
|
|
|
private String fingerprint;
|
|
}
|