diff options
author | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
commit | 171aaece4f23709d33d180cf36eb3af5e454b0c9 (patch) | |
tree | 1485f9f0a7bd10de4ff25030db575dbb8dafae74 /pki/base/common/src/com/netscape/cms/profile/constraint/CAValidityConstraint.java | |
parent | adad2fcee8a29fdb82376fbce07dedb11fccc182 (diff) | |
download | pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.gz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.xz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.zip |
Revert "Formatting"
This reverts commit 32150d3ee32f8ac27118af7c792794b538c78a2f.
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/profile/constraint/CAValidityConstraint.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cms/profile/constraint/CAValidityConstraint.java | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/pki/base/common/src/com/netscape/cms/profile/constraint/CAValidityConstraint.java b/pki/base/common/src/com/netscape/cms/profile/constraint/CAValidityConstraint.java index 17c6c34f5..4d89e7391 100644 --- a/pki/base/common/src/com/netscape/cms/profile/constraint/CAValidityConstraint.java +++ b/pki/base/common/src/com/netscape/cms/profile/constraint/CAValidityConstraint.java @@ -17,6 +17,7 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cms.profile.constraint; + import java.io.IOException; import java.util.Date; import java.util.Locale; @@ -37,10 +38,12 @@ import com.netscape.cms.profile.def.NoDefault; import com.netscape.cms.profile.def.UserValidityDefault; import com.netscape.cms.profile.def.ValidityDefault; + /** - * This class implements the validity constraint. It checks if the validity in - * the certificate template is within the CA's validity. - * + * This class implements the validity constraint. + * It checks if the validity in the certificate + * template is within the CA's validity. + * * @version $Revision$, $Date$ */ public class CAValidityConstraint extends CAEnrollConstraint { @@ -53,7 +56,7 @@ public class CAValidityConstraint extends CAEnrollConstraint { } public void init(IProfile profile, IConfigStore config) - throws EProfileException { + throws EProfileException { super.init(profile, config); X509CertImpl caCert = getCACert(); @@ -62,18 +65,19 @@ public class CAValidityConstraint extends CAEnrollConstraint { } /** - * Validates the request. The request is not modified during the validation. + * Validates the request. The request is not modified + * during the validation. */ public void validate(IRequest request, X509CertInfo info) - throws ERejectException { + throws ERejectException { CMS.debug("CAValidityConstraint: validate start"); CertificateValidity v = null; try { v = (CertificateValidity) info.get(X509CertInfo.VALIDITY); } catch (Exception e) { - throw new ERejectException(CMS.getUserMessage(getLocale(request), - "CMS_PROFILE_VALIDITY_NOT_FOUND")); + throw new ERejectException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_VALIDITY_NOT_FOUND")); } Date notBefore = null; @@ -81,8 +85,8 @@ public class CAValidityConstraint extends CAEnrollConstraint { notBefore = (Date) v.get(CertificateValidity.NOT_BEFORE); } catch (IOException e) { CMS.debug("CAValidity: not before " + e.toString()); - throw new ERejectException(CMS.getUserMessage(getLocale(request), - "CMS_PROFILE_INVALID_NOT_BEFORE")); + throw new ERejectException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_INVALID_NOT_BEFORE")); } Date notAfter = null; @@ -90,33 +94,37 @@ public class CAValidityConstraint extends CAEnrollConstraint { notAfter = (Date) v.get(CertificateValidity.NOT_AFTER); } catch (IOException e) { CMS.debug("CAValidity: not after " + e.toString()); - throw new ERejectException(CMS.getUserMessage(getLocale(request), - "CMS_PROFILE_INVALID_NOT_AFTER")); + throw new ERejectException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_INVALID_NOT_AFTER")); } if (mDefNotBefore != null) { - CMS.debug("ValidtyConstraint: notBefore=" + notBefore - + " defNotBefore=" + mDefNotBefore); + CMS.debug("ValidtyConstraint: notBefore=" + notBefore + + " defNotBefore=" + mDefNotBefore); if (notBefore.before(mDefNotBefore)) { throw new ERejectException(CMS.getUserMessage( - getLocale(request), "CMS_PROFILE_INVALID_NOT_BEFORE")); + getLocale(request), "CMS_PROFILE_INVALID_NOT_BEFORE")); } } - CMS.debug("ValidtyConstraint: notAfter=" + notAfter + " defNotAfter=" - + mDefNotAfter); + CMS.debug("ValidtyConstraint: notAfter=" + notAfter + + " defNotAfter=" + mDefNotAfter); if (notAfter.after(mDefNotAfter)) { - throw new ERejectException(CMS.getUserMessage(getLocale(request), - "CMS_PROFILE_INVALID_NOT_AFTER")); + throw new ERejectException(CMS.getUserMessage( + getLocale(request), "CMS_PROFILE_INVALID_NOT_AFTER")); } CMS.debug("CAValidtyConstraint: validate end"); } public String getText(Locale locale) { - String params[] = { mDefNotBefore.toString(), mDefNotAfter.toString() }; - - return CMS.getUserMessage(locale, - "CMS_PROFILE_CONSTRAINT_CA_VALIDITY_CONSTRAINT_TEXT", params); + String params[] = { + mDefNotBefore.toString(), + mDefNotAfter.toString() + }; + + return CMS.getUserMessage(locale, + "CMS_PROFILE_CONSTRAINT_CA_VALIDITY_CONSTRAINT_TEXT", + params); } public boolean isApplicable(IPolicyDefault def) { |