diff options
Diffstat (limited to 'bkucommon')
-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); |