fix for java 8
This commit is contained in:
parent
a853c02947
commit
a4cb075f42
1 changed files with 5 additions and 7 deletions
|
@ -16,7 +16,7 @@ import java.nio.ByteOrder;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.cert.Certificate;
|
import java.security.cert.Certificate;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.Iterator;
|
import java.util.Enumeration;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -167,13 +167,11 @@ public class CertificateSymetricKeyCryptor extends AbstractCertificateCryptor im
|
||||||
final Certificates certs = this.certificateService
|
final Certificates certs = this.certificateService
|
||||||
.getCertificates(institutionId)
|
.getCertificates(institutionId)
|
||||||
.getOrThrow();
|
.getOrThrow();
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
final Iterator<String> asIterator = certs.keyStore
|
|
||||||
.engineAliases()
|
|
||||||
.asIterator();
|
|
||||||
|
|
||||||
while (asIterator.hasNext()) {
|
@SuppressWarnings("unchecked")
|
||||||
final Certificate certificate = certs.keyStore.engineGetCertificate(asIterator.next());
|
final Enumeration<String> engineAliases = certs.keyStore.engineAliases();
|
||||||
|
while (engineAliases.hasMoreElements()) {
|
||||||
|
final Certificate certificate = certs.keyStore.engineGetCertificate(engineAliases.nextElement());
|
||||||
final byte[] otherPublicKeyHash = generatePublicKeyHash(certificate);
|
final byte[] otherPublicKeyHash = generatePublicKeyHash(certificate);
|
||||||
if (Objects.equals(otherPublicKeyHash, publicKeyHash)) {
|
if (Objects.equals(otherPublicKeyHash, publicKeyHash)) {
|
||||||
return certificate;
|
return certificate;
|
||||||
|
|
Loading…
Reference in a new issue