mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-20 05:28:22 +00:00
Merge pull request #688 from nsacyber/v3_issue-684
[#684] Green Check mark fix
This commit is contained in:
commit
566248b244
@ -16,6 +16,8 @@ public interface CACredentialRepository extends JpaRepository<CertificateAuthori
|
||||
Page<CertificateAuthorityCredential> findByArchiveFlag(boolean archiveFlag, Pageable pageable);
|
||||
List<CertificateAuthorityCredential> findBySubject(String subject);
|
||||
List<CertificateAuthorityCredential> findBySubjectSorted(String subject);
|
||||
List<CertificateAuthorityCredential> findBySubjectAndArchiveFlag(String subject, boolean archiveFlag);
|
||||
List<CertificateAuthorityCredential> findBySubjectSortedAndArchiveFlag(String subject, boolean archiveFlag);
|
||||
CertificateAuthorityCredential findBySubjectKeyIdentifier(byte[] subjectKeyIdentifier);
|
||||
CertificateAuthorityCredential findBySubjectKeyIdString(String subjectKeyIdString);
|
||||
CertificateAuthorityCredential findBySubjectKeyIdStringAndArchiveFlag(String subjectKeyIdString, boolean archiveFlag);
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ public final class CertificateStringMapBuilder {
|
||||
//Check if there is a subject organization
|
||||
if (certificate.getAuthorityKeyIdentifier() != null
|
||||
&& !certificate.getAuthorityKeyIdentifier().isEmpty()) {
|
||||
skiCA = caCredentialRepository.findBySubjectKeyIdString(certificate.getAuthorityKeyIdentifier());
|
||||
skiCA = caCredentialRepository.findBySubjectKeyIdStringAndArchiveFlag(certificate.getAuthorityKeyIdentifier(), false);
|
||||
} else {
|
||||
log.error(String.format("Certificate (%s) for %s has no authority key identifier.",
|
||||
certificate.getClass().toString(), certificate.getSubject()));
|
||||
@ -167,10 +167,10 @@ public final class CertificateStringMapBuilder {
|
||||
if (certificate.getIssuerSorted() == null
|
||||
|| certificate.getIssuerSorted().isEmpty()) {
|
||||
//Get certificates by subject
|
||||
issuerCertificates = caCredentialRepository.findBySubject(certificate.getIssuer());
|
||||
issuerCertificates = caCredentialRepository.findBySubjectAndArchiveFlag(certificate.getIssuer(), false);
|
||||
} else {
|
||||
//Get certificates by subject organization
|
||||
issuerCertificates = caCredentialRepository.findBySubjectSorted(certificate.getIssuerSorted());
|
||||
issuerCertificates = caCredentialRepository.findBySubjectSortedAndArchiveFlag(certificate.getIssuerSorted(), false);
|
||||
}
|
||||
} else {
|
||||
issuerCertificates.add(skiCA);
|
||||
|
Loading…
Reference in New Issue
Block a user