SEBSERV-135 fix
This commit is contained in:
parent
bcdd8b87bd
commit
e88f5146ab
1 changed files with 17 additions and 15 deletions
|
@ -216,23 +216,21 @@ public class CertificateDAOImpl implements CertificateDAO {
|
|||
final boolean[] keyUsage = cert.getKeyUsage();
|
||||
final EnumSet<CertificateType> result = EnumSet.noneOf(CertificateType.class);
|
||||
|
||||
// digitalSignature
|
||||
if (keyUsage[0]) {
|
||||
result.add(CertificateType.DIGITAL_SIGNATURE);
|
||||
}
|
||||
if (keyUsage != null) {
|
||||
// digitalSignature
|
||||
if (keyUsage[0]) {
|
||||
result.add(CertificateType.DIGITAL_SIGNATURE);
|
||||
}
|
||||
|
||||
// dataEncipherment
|
||||
if (keyUsage[2] || keyUsage[3]) {
|
||||
result.add(CertificateType.DATA_ENCIPHERMENT);
|
||||
}
|
||||
// dataEncipherment
|
||||
if (keyUsage[2] || keyUsage[3]) {
|
||||
result.add(CertificateType.DATA_ENCIPHERMENT);
|
||||
}
|
||||
|
||||
// keyCertSign
|
||||
if (keyUsage[5]) {
|
||||
result.add(CertificateType.KEY_CERT_SIGN);
|
||||
}
|
||||
|
||||
if (result.isEmpty()) {
|
||||
result.add(CertificateType.UNKNOWN);
|
||||
// keyCertSign
|
||||
if (keyUsage[5]) {
|
||||
result.add(CertificateType.KEY_CERT_SIGN);
|
||||
}
|
||||
}
|
||||
|
||||
final String alias = certificates.keyStore.engineGetCertificateAlias(cert);
|
||||
|
@ -240,6 +238,10 @@ public class CertificateDAOImpl implements CertificateDAO {
|
|||
result.add(CertificateType.DATA_ENCIPHERMENT_PRIVATE_KEY);
|
||||
}
|
||||
|
||||
if (result.isEmpty()) {
|
||||
result.add(CertificateType.UNKNOWN);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue