package ma;

import com.google.crypto.tink.proto.KeyData$KeyMaterialType;
import com.google.crypto.tink.proto.OutputPrefixType;
import com.google.crypto.tink.shaded.protobuf.ByteString;
import java.security.GeneralSecurityException;

/* JADX INFO: loaded from: classes2.dex */
public final class h0 implements k0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f30520a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final ta.a f30521b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final ByteString f30522c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final KeyData$KeyMaterialType f30523d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final OutputPrefixType f30524e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final Integer f30525f;

    public h0(String str, ta.a aVar, ByteString byteString, KeyData$KeyMaterialType keyData$KeyMaterialType, OutputPrefixType outputPrefixType, Integer num) {
        this.f30520a = str;
        this.f30521b = aVar;
        this.f30522c = byteString;
        this.f30523d = keyData$KeyMaterialType;
        this.f30524e = outputPrefixType;
        this.f30525f = num;
    }

    public static h0 a(String str, ByteString byteString, KeyData$KeyMaterialType keyData$KeyMaterialType, OutputPrefixType outputPrefixType, Integer num) throws GeneralSecurityException {
        if (outputPrefixType == OutputPrefixType.RAW) {
            if (num != null) {
                throw new GeneralSecurityException("Keys with output prefix type raw should not have an id requirement.");
            }
        } else if (num == null) {
            throw new GeneralSecurityException("Keys with output prefix type different from raw should have an id requirement.");
        }
        return new h0(str, p0.a(str), byteString, keyData$KeyMaterialType, outputPrefixType, num);
    }
}
