diff options
author | James Moger <james.moger@gitblit.com> | 2014-04-17 22:46:57 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-04-17 23:08:07 -0400 |
commit | aff53ab4b5940cdee22b0fd79fc0df473c063ab5 (patch) | |
tree | d3739f9d67a5754465c84c85576dfc72bf35b219 | |
parent | 872462169ff63dfcd86ecb3f6e699686f1d3f725 (diff) | |
download | gitblit-aff53ab4b5940cdee22b0fd79fc0df473c063ab5.tar.gz gitblit-aff53ab4b5940cdee22b0fd79fc0df473c063ab5.zip |
[findbugs] Explicitly catch thrown exceptions in X509Utils
-rw-r--r-- | src/main/java/com/gitblit/utils/X509Utils.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/utils/X509Utils.java b/src/main/java/com/gitblit/utils/X509Utils.java index d3d5b46f..f0c1b9df 100644 --- a/src/main/java/com/gitblit/utils/X509Utils.java +++ b/src/main/java/com/gitblit/utils/X509Utils.java @@ -36,6 +36,7 @@ import java.security.cert.CertPathBuilder; import java.security.cert.CertPathBuilderException;
import java.security.cert.CertStore;
import java.security.cert.Certificate;
+import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateFactory;
import java.security.cert.CollectionCertStoreParameters;
import java.security.cert.PKIXBuilderParameters;
@@ -81,6 +82,7 @@ import org.bouncycastle.jce.PrincipalUtil; import org.bouncycastle.jce.interfaces.PKCS12BagAttributeCarrier;
import org.bouncycastle.openssl.PEMWriter;
import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.OperatorCreationException;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1070,7 +1072,7 @@ public class X509Utils { x509log.log(MessageFormat.format("Revoked certificate {0,number,0} reason: {1} [{2}]",
cert.getSerialNumber(), reason.toString(), cert.getSubjectDN().getName()));
return true;
- } catch (Exception e) {
+ } catch (IOException | OperatorCreationException | CertificateEncodingException e) {
logger.error(MessageFormat.format("Failed to revoke certificate {0,number,0} [{1}] in {2}",
cert.getSerialNumber(), cert.getSubjectDN().getName(), caRevocationList));
}
|