package androidx.credentials.webauthn;

import androidx.credentials.webauthn.WebAuthnUtils;
import androidx.media3.container.NalUnitUtil;
import com.google.android.gms.fido.u2f.api.common.ClientData;
import defpackage.cr4;
import defpackage.kp6;
import defpackage.m38;
import kotlin.Metadata;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes.dex */
@m38
@Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\t\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004R\u0011\u0010\u0005\u001a\u00020\u0006¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u0011\u0010\t\u001a\u00020\n¢\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\fR\u0011\u0010\r\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\u000fR\u0011\u0010\u0010\u001a\u00020\u0011¢\u0006\b\n\u0000\u001a\u0004\b\u0012\u0010\u0013R\u0011\u0010\u0014\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0015\u0010\u000f¨\u0006\u0016"}, d2 = {"Landroidx/credentials/webauthn/PublicKeyCredentialRequestOptions;", "", "requestJson", "", "(Ljava/lang/String;)V", ClientData.KEY_CHALLENGE, "", "getChallenge", "()[B", "json", "Lorg/json/JSONObject;", "getJson", "()Lorg/json/JSONObject;", "rpId", "getRpId", "()Ljava/lang/String;", "timeout", "", "getTimeout", "()J", "userVerification", "getUserVerification", "credentials_release"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public final class PublicKeyCredentialRequestOptions {

    @kp6
    private final byte[] challenge;

    @kp6
    private final JSONObject json;

    @kp6
    private final String rpId;
    private final long timeout;

    @kp6
    private final String userVerification;

    public PublicKeyCredentialRequestOptions(@kp6 String str) throws JSONException {
        cr4.g(str, "requestJson");
        JSONObject jSONObject = new JSONObject(str);
        this.json = jSONObject;
        String string = jSONObject.getString(ClientData.KEY_CHALLENGE);
        WebAuthnUtils.Companion companion = WebAuthnUtils.INSTANCE;
        cr4.f(string, "challengeString");
        this.challenge = companion.b64Decode(string);
        this.timeout = jSONObject.optLong("timeout", 0L);
        String strOptString = jSONObject.optString("rpId", "");
        cr4.f(strOptString, "json.optString(\"rpId\", \"\")");
        this.rpId = strOptString;
        String strOptString2 = jSONObject.optString("userVerification", "preferred");
        cr4.f(strOptString2, "json.optString(\"userVerification\", \"preferred\")");
        this.userVerification = strOptString2;
    }

    @kp6
    public final byte[] getChallenge() {
        return this.challenge;
    }

    @kp6
    public final JSONObject getJson() {
        return this.json;
    }

    @kp6
    public final String getRpId() {
        return this.rpId;
    }

    public final long getTimeout() {
        return this.timeout;
    }

    @kp6
    public final String getUserVerification() {
        return this.userVerification;
    }
}
