|
|
|
@ -1121,7 +1121,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
|
|
|
|
// throws DecoderException extends IllegalStateException
|
|
|
|
|
PemObject pem = new PemReader(new InputStreamReader(is)).readPemObject();
|
|
|
|
|
if (pem == null)
|
|
|
|
|
throw new IllegalStateException("Invalid key file");
|
|
|
|
|
throw new IllegalArgumentException("Invalid key file");
|
|
|
|
|
ByteArrayInputStream bis = new ByteArrayInputStream(pem.getContent());
|
|
|
|
|
cert = (X509Certificate) fact.generateCertificate(bis);
|
|
|
|
|
}
|
|
|
|
@ -1147,7 +1147,9 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
boolean expected = (ex instanceof SecurityException);
|
|
|
|
|
boolean expected =
|
|
|
|
|
(ex instanceof IllegalArgumentException ||
|
|
|
|
|
ex instanceof SecurityException);
|
|
|
|
|
Log.unexpectedError(getSupportFragmentManager(), ex, !expected);
|
|
|
|
|
}
|
|
|
|
|
}.execute(this, args, "setup:cert");
|
|
|
|
|