package w7;

import java.nio.charset.StandardCharsets;
import java.security.KeyStore;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.GCMParameterSpec;

/* loaded from: classes.dex */
public class c {

    /* renamed from: a, reason: collision with root package name */
    private KeyStore f40948a;

    public c() {
        c();
    }

    private SecretKey b(String str) {
        return ((KeyStore.SecretKeyEntry) this.f40948a.getEntry(str, null)).getSecretKey();
    }

    private void c() {
        KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
        this.f40948a = keyStore;
        keyStore.load(null);
    }

    public String a(String str, byte[] bArr, byte[] bArr2) {
        Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
        cipher.init(2, b(str), new GCMParameterSpec(128, bArr2));
        return new String(cipher.doFinal(bArr), StandardCharsets.UTF_8);
    }
}
