package com.airlock.iam.common.domain.model.jwt;

import com.airlock.iam.common.domain.model.jwt.signature.SignatureAlgorithm;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.security.cert.X509Certificate;

public final class SignatureVerificationInformation {
   private final SignatureAlgorithm algorithm;
   private final X509Certificate certificate;

   public static SignatureVerificationInformation signatureVerificationInformation(SignatureAlgorithm algorithm, X509Certificate certificate) {
      return new SignatureVerificationInformation(algorithm, certificate);
   }

   @SuppressFBWarnings(justification = "generated code")
   public SignatureVerificationInformation(SignatureAlgorithm algorithm, X509Certificate certificate) {
      this.algorithm = algorithm;
      this.certificate = certificate;
   }

   @SuppressFBWarnings(justification = "generated code")
   public SignatureAlgorithm getAlgorithm() {
      return this.algorithm;
   }

   @SuppressFBWarnings(justification = "generated code")
   public X509Certificate getCertificate() {
      return this.certificate;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof SignatureVerificationInformation other)) {
         return false;
      } else {
         Object this$algorithm = this.algorithm;
         Object other$algorithm = other.algorithm;
         if (this$algorithm == null ? other$algorithm == null : this$algorithm.equals(other$algorithm)) {
            Object this$certificate = this.certificate;
            Object other$certificate = other.certificate;
            return this$certificate == null ? other$certificate == null : this$certificate.equals(other$certificate);
         } else {
            return false;
         }
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $algorithm = this.algorithm;
      result = result * 59 + ($algorithm == null ? 43 : $algorithm.hashCode());
      Object $certificate = this.certificate;
      return result * 59 + ($certificate == null ? 43 : $certificate.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "SignatureVerificationInformation(algorithm=" + this.getAlgorithm() + ", certificate=" + this.getCertificate() + ")";
   }
}
