diff options
author | tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2012-07-13 10:00:21 +0000 |
---|---|---|
committer | tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2012-07-13 10:00:21 +0000 |
commit | e6e4bdc24bbb6f59e80d1ad0765cf8111695e3d3 (patch) | |
tree | 937dc4134c2cd747355f3a250284ecfd1b86f1e9 /bkucommon/src | |
parent | f5bf10cf2fd495f32ba89ffaee11a3b5137e738d (diff) | |
download | mocca-e6e4bdc24bbb6f59e80d1ad0765cf8111695e3d3.tar.gz mocca-e6e4bdc24bbb6f59e80d1ad0765cf8111695e3d3.tar.bz2 mocca-e6e4bdc24bbb6f59e80d1ad0765cf8111695e3d3.zip |
Check signing certificate for validity
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1103 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'bkucommon/src')
-rw-r--r-- | bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java index 4827ab16..5f8bebec 100644 --- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java +++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java @@ -25,6 +25,8 @@ package at.gv.egiz.bku.slcommands.impl; import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateExpiredException; +import java.security.cert.CertificateNotYetValidException; import java.security.cert.X509Certificate; import java.util.Collections; import java.util.Date; @@ -229,6 +231,16 @@ public class CreateXMLSignatureCommandImpl extends log.info("Got signing certificate."); } + // check certificate for validity + try { + signingCertificate.checkValidity(); + log.info("signing certificate is valid"); + } catch (CertificateExpiredException e) { + log.warn("Your signing certificate has expired!"); + } catch (CertificateNotYetValidException e) { + log.warn("Your signing certificate is not yet valid!"); + } + // prepare the XMLSignature for signing log.info("Preparing XML signature."); prepareXMLSignature(commandContext); |