-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #648 from 3KeyCompany/release/2.11.0
Update release version to 2.11.0
- Loading branch information
Showing
46 changed files
with
1,348 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.czertainly.core.dao.entity; | ||
|
||
import com.fasterxml.jackson.annotation.JsonBackReference; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.UUID; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@Setter | ||
@Entity | ||
@Table(name = "crl") | ||
public class Crl extends UniquelyIdentified { | ||
@Column(name = "ca_certificate_uuid") | ||
private UUID caCertificateUuid; | ||
|
||
@Column(name = "issuer_dn", nullable = false) | ||
private String issuerDn; | ||
|
||
@Column(name = "serial_number", nullable = false) | ||
private String serialNumber; | ||
|
||
@Column(name = "crl_issuer_dn", nullable = false) | ||
private String crlIssuerDn; | ||
|
||
@Column(name = "crl_number", nullable = false) | ||
private String crlNumber; | ||
|
||
@Column(name = "next_update", nullable = false) | ||
private Date nextUpdate; | ||
|
||
@Column(name = "crl_number_delta") | ||
private String crlNumberDelta; | ||
|
||
@Column(name = "next_update_delta") | ||
private Date nextUpdateDelta; | ||
|
||
@Column(name = "last_revocation_date") | ||
private Date lastRevocationDate; | ||
|
||
@OneToMany(mappedBy = "crl", fetch = FetchType.LAZY) | ||
@JsonBackReference | ||
private List<CrlEntry> crlEntries; | ||
|
||
public Map<String, CrlEntry> getCrlEntriesMap() { | ||
return crlEntries.stream().collect(Collectors.toMap(crlEntry -> crlEntry.getId().getSerialNumber(), crlEntry -> crlEntry)); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
src/main/java/com/czertainly/core/dao/entity/CrlEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.czertainly.core.dao.entity; | ||
|
||
import com.czertainly.api.model.core.authority.CertificateRevocationReason; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
import java.util.Objects; | ||
import java.util.UUID; | ||
|
||
@Getter | ||
@Setter | ||
@Entity | ||
@Table(name = "crl_entry") | ||
public class CrlEntry implements Serializable { | ||
|
||
@EmbeddedId | ||
private CrlEntryId id = new CrlEntryId(); | ||
|
||
@ManyToOne | ||
@MapsId("crlUuid") | ||
private Crl crl; | ||
|
||
@Column(name = "revocation_date", nullable = false) | ||
private Date revocationDate; | ||
|
||
@Column(name = "revocation_reason", nullable = false) | ||
@Enumerated(EnumType.STRING) | ||
private CertificateRevocationReason revocationReason; | ||
|
||
public UUID getCrlUuid() { | ||
return crl.getUuid(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
|
||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
|
||
CrlEntry that = (CrlEntry) o; | ||
return Objects.equals(crl, that.crl) && | ||
Objects.equals(id.getSerialNumber(), that.getId().getSerialNumber()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(getCrlUuid(), id.getSerialNumber()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CertificateLocation{" + | ||
"id=" + id + | ||
", revocationReason='" + revocationReason + '\'' + | ||
", revocationDate='" + revocationDate + '\'' + | ||
'}'; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.