Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit bd2fb71f authored by Sebastian-Ion TINCU's avatar Sebastian-Ion TINCU
Browse files

Pull request #89: EDELIVERY-13046 SMP - Keystore - Non-keypair Entries...

Pull request #89: EDELIVERY-13046 SMP - Keystore - Non-keypair Entries Containing Only Certificates Present in the Keystore Are Not Displayed

Merge in EDELIVERY/smp from bugfix/EDELIVERY-13046-smp-keystore-non-keypair-entries-containing-only-certificates-present-in-the to development

* commit 'fdee757a':
  EDELIVERY-13046 SMP - Keystore - Non-keypair Entries Containing Only Certificates Present in the Keystore Are Not Displayed
parents 96dbbbe0 fdee757a
Branches bugfix/EDELIVERY-13128-upgrade-libraries-and-plugins
No related tags found
No related merge requests found
Pipeline #155786 passed with warnings
<div id="admin-keystore-panel">
<data-panel id="admin-keystore-data-panel"
title="Keystore administration"
text="Keystore is contains keys for singing responses and Client keys for SML integrations ."
text="Keystore contains keys for signing responses and Client keys for SML integrations."
[labelColumnContent]="searchKeyCertificatePanel">
<ng-template #noDataFound>
<div class="empty-data-panel">No certificate selected.</div>
......@@ -43,6 +43,16 @@
[matTooltip]="row.certificateId">{{row.alias}}</td>
</ng-container>
<ng-container matColumnDef="entry-type">
<th mat-header-cell *matHeaderCellDef>Type</th>
<td mat-cell *matCellDef="let row"
[ngClass]="{'datatable-row-error': row.invalid}"
[matTooltip]="row.containingKey ? 'Key Pair': 'Certificate'">
<span *ngIf="!!row.containingKey"><mat-icon>key</mat-icon></span>
<span *ngIf="!row.containingKey"><mat-icon>article</mat-icon></span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let odd = odd; let row; columns: displayedColumns;"
(click)="certificateSelected(row)"
......
......@@ -18,7 +18,7 @@ import {CertificateRo} from "../../common/model/certificate-ro.model";
styleUrls: ['./admin-keystore.component.css']
})
export class AdminKeystoreComponent implements OnInit, OnDestroy, AfterViewInit, BeforeLeaveGuard {
displayedColumns: string[] = ['alias'];
displayedColumns: string[] = ['alias', 'entry-type'];
dataSource: MatTableDataSource<CertificateRo> = new MatTableDataSource();
keystoreCertificates: CertificateRo[];
selected?: CertificateRo;
......@@ -100,10 +100,8 @@ export class AdminKeystoreComponent implements OnInit, OnDestroy, AfterViewInit,
this.dataSource.data = this.keystoreCertificates;
// show the last page
this.paginator.lastPage();
}
applyKeyAliasFilter(event: Event) {
const filterValue = (event.target as HTMLInputElement).value;
this.dataSource.filter = filterValue.trim().toLowerCase();
......
......@@ -175,8 +175,8 @@ public class UIKeystoreService extends BasicKeystoreService {
private void loadKeyAndCert(KeyStore keyStore, String alias, String keySecurityToken, Map<String, Key> hmKeys, Map<String, X509Certificate> hmCertificates) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException {
Key key = keyStore.getKey(alias, keySecurityToken.toCharArray());
Certificate certificate = keyStore.getCertificate(alias);
if (key == null || certificate == null || !(certificate instanceof X509Certificate)) {
LOG.warn("Wrong entry type found in keystore, only certificates with keypair are accepted, entry alias: [{}]. Entry is ignored", alias);
if (!(certificate instanceof X509Certificate)) {
LOG.warn("Wrong certificate type found in keystore, entry alias: [{}]. Entry is ignored", alias);
return;
}
// add to cache
......@@ -196,7 +196,7 @@ public class UIKeystoreService extends BasicKeystoreService {
CertificateRO certificateRO = convertToRo(cert);
basicCertificateValidation(cert, certificateRO);
certificateRO.setAlias(alias);
certificateRO.setContainingKey(keystoreKeys.containsKey(alias));
certificateRO.setContainingKey(keystoreKeys.get(alias) != null);
certificateROList.add(certificateRO);
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment