package ඓ.ඓ.K.䁗;

import com.facebook.internal.security.CertificateUtil;
import com.google.gson.Gson;
import java.security.GeneralSecurityException;
import java.util.HashMap;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import ඓ.ⁱ.K.ඓ.C1252;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.㳳.C1841;

/* renamed from: ඓ.ඓ.K.䁗.K  reason: contains not printable characters */
/* compiled from: Auth */
public final class C0727 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static final String[] f3745 = {"callbackUrl", "callbackBody", "callbackHost", "callbackBodyType", "callbackFetchKey", "returnUrl", "returnBody", "endUser", "saveKey", "insertOnly", "isPrefixalScope", "detectMime", "mimeLimit", "fsizeLimit", "fsizeMin", "persistentOps", "persistentNotifyUrl", "persistentPipeline", "deleteAfterDays", "fileType"};

    /* renamed from: 㸾  reason: contains not printable characters */
    public static final String[] f3746 = {"asyncOps"};

    /* renamed from: ῲ  reason: contains not printable characters */
    public final SecretKeySpec f3747;

    /* renamed from: K  reason: contains not printable characters */
    public final String f3748;

    public C0727(String str, SecretKeySpec secretKeySpec) {
        this.f3748 = str;
        this.f3747 = secretKeySpec;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C0727 m2149(String str, String str2) {
        boolean z = false;
        if (!(str == null || "".equals(str))) {
            if (str2 == null || "".equals(str2)) {
                z = true;
            }
            if (!z) {
                return new C0727(str, new SecretKeySpec(C1841.m4745(str2), "HmacSHA1"));
            }
        }
        throw new IllegalArgumentException("empty key");
    }

    /* renamed from: K  reason: contains not printable characters */
    public String m2150(String str) {
        HashMap hashMap = new HashMap();
        hashMap.put("scope", str);
        hashMap.put("deadline", Long.valueOf((System.currentTimeMillis() / 1000) + 3600));
        String r6 = C1252.m3343(C1841.m4745(new Gson().toJson(hashMap)));
        StringBuilder sb = new StringBuilder();
        byte[] r1 = C1841.m4745(r6);
        try {
            Mac instance = Mac.getInstance("HmacSHA1");
            instance.init(this.f3747);
            String r12 = C1252.m3343(instance.doFinal(r1));
            sb.append(this.f3748 + CertificateUtil.DELIMITER + r12);
            return C1293.m3414(sb, CertificateUtil.DELIMITER, r6);
        } catch (GeneralSecurityException e) {
            e.printStackTrace();
            throw new IllegalArgumentException(e);
        }
    }
}
