package g9;

import ca.canadapost.core.data.auth.model.CpcIdPayload;
import java.util.Base64;
import java.util.List;

/* loaded from: classes.dex */
public final class a {

    /* renamed from: a, reason: collision with root package name */
    public static final C0427a f19077a = new C0427a(null);

    /* renamed from: g9.a$a, reason: collision with other inner class name */
    /* loaded from: classes.dex */
    public static final class C0427a {
        private C0427a() {
        }

        public /* synthetic */ C0427a(kotlin.jvm.internal.k kVar) {
            this();
        }

        public final String a(String jwtToken) {
            kotlin.jvm.internal.t.g(jwtToken, "jwtToken");
            return new a().c(jwtToken);
        }
    }

    private final String b(String str) {
        byte[] decode = Base64.getDecoder().decode(str);
        kotlin.jvm.internal.t.d(decode);
        return new String(decode, kotlin.text.d.f26484b);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final String c(String str) {
        List I0;
        I0 = kotlin.text.z.I0(str, new String[]{"."}, false, 0, 6, null);
        return d((String) I0.get(1));
    }

    private final String d(String str) {
        return ((CpcIdPayload) new com.google.gson.d().j(b(str), CpcIdPayload.class)).getSub();
    }
}
