package com.airlock.iam.factor.domain.model.fido;

import com.airlock.iam.base.misc.result.Result;
import com.airlock.iam.factor.domain.model.fido.user.FidoUser;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;

public interface FidoRelyingParty {
   Result<FidoAuthenticatorVerifiedAttestationResponse, FidoRelyingParty.FidoRegistrationVerificationError> verifyRegistration(
      FidoPublicKeyCredentialCreationOptions var1, FidoAuthenticatorUnverifiedAttestationResponse var2, FidoAttestationVerifier var3
   );

   Optional<FidoAuthenticatorVerifiedAssertionResponse> verifyAuthentication(
      FidoPublicKeyCredentialRequestOptions var1, FidoUser var2, FidoAuthenticatorUnverifiedAssertionResponse var3
   );

   enum FidoAuthenticationVerificationErrorCode {
      AUTHENTICATION_FAILED,
      AUTHENTICATION_TIMEOUT;
   }

   final class FidoRegistrationVerificationError {
      private final FidoRelyingParty.FidoRegistrationVerificationErrorCode errorCode;
      private final String message;

      @SuppressFBWarnings(justification = "generated code")
      public FidoRegistrationVerificationError(FidoRelyingParty.FidoRegistrationVerificationErrorCode errorCode, String message) {
         this.errorCode = errorCode;
         this.message = message;
      }

      @SuppressFBWarnings(justification = "generated code")
      public FidoRelyingParty.FidoRegistrationVerificationErrorCode getErrorCode() {
         return this.errorCode;
      }

      @SuppressFBWarnings(justification = "generated code")
      public String getMessage() {
         return this.message;
      }

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

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

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "FidoRelyingParty.FidoRegistrationVerificationError(errorCode=" + this.getErrorCode() + ", message=" + this.getMessage() + ")";
      }
   }

   enum FidoRegistrationVerificationErrorCode {
      ATTESTATION_VERIFICATION_FAILED,
      REGISTRATION_FAILED,
      REGISTRATION_TIMEOUT;
   }
}
