Merge "[OOM-CERT-SERVICE] Refactor CmpResponseValidationHelper"
authorBogumil Zebek <bogumil.zebek@nokia.com>
Mon, 19 Jul 2021 08:03:29 +0000 (08:03 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 19 Jul 2021 08:03:29 +0000 (08:03 +0000)
1  2 
certService/src/main/java/org/onap/oom/certservice/cmpv2client/validation/CmpCertificationValidator.java

@@@ -1,7 -1,8 +1,7 @@@
  /*-
   * ============LICENSE_START=======================================================
   * Copyright (C) 2020 Nordix Foundation.
 - * ================================================================================
 - * Modification copyright 2021 Nokia
 + * Copyright (C) 2021 Nokia.
   * ================================================================================
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
@@@ -42,9 -43,9 +42,9 @@@ import java.util.Date
  import java.util.Objects;
  import java.util.Optional;
  
- import static org.onap.oom.certservice.cmpv2client.impl.CmpResponseValidationHelper.checkImplicitConfirm;
- import static org.onap.oom.certservice.cmpv2client.impl.CmpResponseValidationHelper.verifyPasswordBasedProtection;
- import static org.onap.oom.certservice.cmpv2client.impl.CmpResponseValidationHelper.verifySignature;
+ import static org.onap.oom.certservice.cmpv2client.validation.CmpResponseValidationHelper.checkImplicitConfirm;
+ import static org.onap.oom.certservice.cmpv2client.validation.CmpResponseValidationHelper.verifyPasswordBasedProtection;
+ import static org.onap.oom.certservice.cmpv2client.validation.CmpResponseValidationHelper.verifySignature;
  
  public class CmpCertificationValidator {
      private static final String DEFAULT_CA_NAME = "Certification Authority";
@@@ -74,7 -75,6 +74,7 @@@
          if (notBefore != null && notAfter != null && notBefore.compareTo(notAfter) > 0) {
              throw new IllegalArgumentException("Before Date is set after the After Date");
          }
 +        LOG.info("Validation completed successfully.");
      }
  
      public void checkCmpResponse(final PKIMessage respPkiMessage, final PublicKey publicKey, final String initAuthPassword)
      }
  
      private void logServerResponse(CertResponse certResponse) {
 -        if (LOG.isInfoEnabled()) {
 -            LOG.info("Response status code: {}", certResponse.getStatus().getStatus());
 -        }
 +        LOG.info("Response status code: {}", certResponse.getStatus().getStatus());
          if (certResponse.getStatus().getStatusString() != null) {
              String serverMessage = certResponse.getStatus().getStatusString().getStringAt(0).getString();
              LOG.warn("Response status text: {}", serverMessage);