package com.google.android.gms.internal.p002firebaseauthapi; import java.nio.ByteBuffer; import java.security.GeneralSecurityException; /* loaded from: classes.dex */ public final class zzni { private zznv zza = null; private zzwj zzb = null; private Integer zzc = null; /* synthetic */ zzni(zznh zznhVar) { } public final zzni zza(Integer num) { this.zzc = num; return this; } public final zzni zzb(zzwj zzwjVar) { this.zzb = zzwjVar; return this; } public final zzni zzc(zznv zznvVar) { this.zza = zznvVar; return this; } public final zznk zzd() { zzwj zzwjVar; zzwi zzb; zznv zznvVar = this.zza; if (zznvVar == null || (zzwjVar = this.zzb) == null) { throw new GeneralSecurityException("Cannot build without parameters and/or key material"); } if (zznvVar.zzb() != zzwjVar.zza()) { throw new GeneralSecurityException("Key size mismatch"); } if (zznvVar.zzg() && this.zzc == null) { throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement"); } if (!this.zza.zzg() && this.zzc != null) { throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement"); } if (this.zza.zzf() == zznt.zzd) { zzb = zzwi.zzb(new byte[0]); } else if (this.zza.zzf() == zznt.zzc || this.zza.zzf() == zznt.zzb) { zzb = zzwi.zzb(ByteBuffer.allocate(5).put((byte) 0).putInt(this.zzc.intValue()).array()); } else { if (this.zza.zzf() != zznt.zza) { throw new IllegalStateException("Unknown HmacParameters.Variant: ".concat(String.valueOf(this.zza.zzf()))); } zzb = zzwi.zzb(ByteBuffer.allocate(5).put((byte) 1).putInt(this.zzc.intValue()).array()); } return new zznk(this.zza, this.zzb, zzb, this.zzc, null); } private zzni() { } }