]> source.dussan.org Git - gitblit.git/commitdiff
[findbugs] Explicitly catch thrown exceptions in X509Utils
authorJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 02:46:57 +0000 (22:46 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 03:08:07 +0000 (23:08 -0400)
src/main/java/com/gitblit/utils/X509Utils.java

index d3d5b46f3656980c820a3fc1a7f5c9b17295f038..f0c1b9dfd69a03685515536a87d7e8ef752f547f 100644 (file)
@@ -36,6 +36,7 @@ import java.security.cert.CertPathBuilder;
 import java.security.cert.CertPathBuilderException;\r
 import java.security.cert.CertStore;\r
 import java.security.cert.Certificate;\r
+import java.security.cert.CertificateEncodingException;\r
 import java.security.cert.CertificateFactory;\r
 import java.security.cert.CollectionCertStoreParameters;\r
 import java.security.cert.PKIXBuilderParameters;\r
@@ -81,6 +82,7 @@ import org.bouncycastle.jce.PrincipalUtil;
 import org.bouncycastle.jce.interfaces.PKCS12BagAttributeCarrier;\r
 import org.bouncycastle.openssl.PEMWriter;\r
 import org.bouncycastle.operator.ContentSigner;\r
+import org.bouncycastle.operator.OperatorCreationException;\r
 import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
@@ -1070,7 +1072,7 @@ public class X509Utils {
                        x509log.log(MessageFormat.format("Revoked certificate {0,number,0} reason: {1} [{2}]",\r
                                        cert.getSerialNumber(), reason.toString(), cert.getSubjectDN().getName()));\r
                        return true;\r
-               } catch (Exception e) {\r
+               } catch (IOException | OperatorCreationException | CertificateEncodingException e) {\r
                        logger.error(MessageFormat.format("Failed to revoke certificate {0,number,0} [{1}] in {2}",\r
                                        cert.getSerialNumber(), cert.getSubjectDN().getName(), caRevocationList));\r
                }\r