32 lines
1.7 KiB
Java
32 lines
1.7 KiB
Java
|
package com.google.android.gms.internal.p002firebaseauthapi;
|
||
|
|
||
|
import java.security.GeneralSecurityException;
|
||
|
import java.security.InvalidAlgorithmParameterException;
|
||
|
import java.util.Locale;
|
||
|
import java.util.regex.Pattern;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class zzqs {
|
||
|
private static final Pattern zza = Pattern.compile(String.format("^projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s$", "([0-9a-zA-Z\\-\\.\\_~])+", "([0-9a-zA-Z\\-\\.\\_~])+", "([0-9a-zA-Z\\-\\.\\_~])+", "([0-9a-zA-Z\\-\\.\\_~])+"), 2);
|
||
|
private static final Pattern zzb = Pattern.compile(String.format("^projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s/cryptoKeyVersions/%s$", "([0-9a-zA-Z\\-\\.\\_~])+", "([0-9a-zA-Z\\-\\.\\_~])+", "([0-9a-zA-Z\\-\\.\\_~])+", "([0-9a-zA-Z\\-\\.\\_~])+", "([0-9a-zA-Z\\-\\.\\_~])+"), 2);
|
||
|
|
||
|
public static String zza(String str, String str2) {
|
||
|
if (!str2.toLowerCase(Locale.US).startsWith("android-keystore://")) {
|
||
|
throw new IllegalArgumentException(String.format("key URI must start with %s", "android-keystore://"));
|
||
|
}
|
||
|
return str2.substring(19);
|
||
|
}
|
||
|
|
||
|
public static void zzb(int i) throws InvalidAlgorithmParameterException {
|
||
|
if (i != 16 && i != 32) {
|
||
|
throw new InvalidAlgorithmParameterException(String.format("invalid key size %d; only 128-bit and 256-bit AES keys are supported", Integer.valueOf(i * 8)));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static void zzc(int i, int i2) throws GeneralSecurityException {
|
||
|
if (i < 0 || i > 0) {
|
||
|
throw new GeneralSecurityException(String.format("key has version %d; only keys with version in range [0..%d] are supported", Integer.valueOf(i), 0));
|
||
|
}
|
||
|
}
|
||
|
}
|