package s;

import android.hardware.biometrics.BiometricPrompt;
import android.security.identity.IdentityCredential;
import android.util.Log;
import androidx.core.hardware.fingerprint.a;
import java.security.Signature;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import s.f;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public abstract class i {

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static class a {
        static BiometricPrompt.CryptoObject a(Signature signature) {
            return new BiometricPrompt.CryptoObject(signature);
        }

        static BiometricPrompt.CryptoObject b(Cipher cipher) {
            return new BiometricPrompt.CryptoObject(cipher);
        }

        static BiometricPrompt.CryptoObject c(Mac mac) {
            return new BiometricPrompt.CryptoObject(mac);
        }

        static Cipher d(BiometricPrompt.CryptoObject cryptoObject) {
            return cryptoObject.getCipher();
        }

        static Mac e(BiometricPrompt.CryptoObject cryptoObject) {
            return cryptoObject.getMac();
        }

        static Signature f(BiometricPrompt.CryptoObject cryptoObject) {
            return cryptoObject.getSignature();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static class b {
        static BiometricPrompt.CryptoObject a(IdentityCredential identityCredential) {
            return new BiometricPrompt.CryptoObject(identityCredential);
        }

        static IdentityCredential b(BiometricPrompt.CryptoObject cryptoObject) {
            return cryptoObject.getIdentityCredential();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static f.c a(BiometricPrompt.CryptoObject cryptoObject) {
        if (cryptoObject == null) {
            return null;
        }
        Cipher d10 = a.d(cryptoObject);
        if (d10 != null) {
            return new f.c(d10);
        }
        Signature f10 = a.f(cryptoObject);
        if (f10 != null) {
            return new f.c(f10);
        }
        Mac e10 = a.e(cryptoObject);
        if (e10 != null) {
            return new f.c(e10);
        }
        IdentityCredential b10 = b.b(cryptoObject);
        if (b10 != null) {
            return new f.c(b10);
        }
        return null;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static f.c b(a.e eVar) {
        if (eVar == null) {
            return null;
        }
        Cipher a10 = eVar.a();
        if (a10 != null) {
            return new f.c(a10);
        }
        Signature c10 = eVar.c();
        if (c10 != null) {
            return new f.c(c10);
        }
        Mac b10 = eVar.b();
        if (b10 != null) {
            return new f.c(b10);
        }
        return null;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static BiometricPrompt.CryptoObject c(f.c cVar) {
        if (cVar == null) {
            return null;
        }
        Cipher a10 = cVar.a();
        if (a10 != null) {
            return a.b(a10);
        }
        Signature d10 = cVar.d();
        if (d10 != null) {
            return a.a(d10);
        }
        Mac c10 = cVar.c();
        if (c10 != null) {
            return a.c(c10);
        }
        IdentityCredential b10 = cVar.b();
        if (b10 != null) {
            return b.a(b10);
        }
        return null;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static a.e d(f.c cVar) {
        if (cVar == null) {
            return null;
        }
        Cipher a10 = cVar.a();
        if (a10 != null) {
            return new a.e(a10);
        }
        Signature d10 = cVar.d();
        if (d10 != null) {
            return new a.e(d10);
        }
        Mac c10 = cVar.c();
        if (c10 != null) {
            return new a.e(c10);
        }
        if (cVar.b() != null) {
            Log.e("CryptoObjectUtils", "Identity credential is not supported by FingerprintManager.");
        }
        return null;
    }
}
