Key errors are expected

This commit is contained in:
M66B 2020-07-28 15:14:38 +02:00
parent eade6d1c5d
commit 55a8fbc1f9
1 changed files with 8 additions and 2 deletions

View File

@ -127,6 +127,7 @@ import org.bouncycastle.cms.jcajce.JceCMSContentEncryptorBuilder;
import org.bouncycastle.cms.jcajce.JceKeyTransRecipientInfoGenerator; import org.bouncycastle.cms.jcajce.JceKeyTransRecipientInfoGenerator;
import org.bouncycastle.operator.ContentSigner; import org.bouncycastle.operator.ContentSigner;
import org.bouncycastle.operator.DigestCalculatorProvider; import org.bouncycastle.operator.DigestCalculatorProvider;
import org.bouncycastle.operator.OperatorCreationException;
import org.bouncycastle.operator.OutputEncryptor; import org.bouncycastle.operator.OutputEncryptor;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder; import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
@ -152,6 +153,7 @@ import java.io.OutputStream;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException; import java.security.GeneralSecurityException;
import java.security.InvalidKeyException;
import java.security.PrivateKey; import java.security.PrivateKey;
import java.security.cert.CertificateException; import java.security.cert.CertificateException;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
@ -2661,8 +2663,12 @@ public class FragmentCompose extends FragmentBase {
} }
}); });
snackbar.show(); snackbar.show();
} else } else {
Log.unexpectedError(getParentFragmentManager(), ex); boolean expected =
(ex instanceof OperatorCreationException &&
ex.getCause() instanceof InvalidKeyException);
Log.unexpectedError(getParentFragmentManager(), ex, !expected);
}
} }
}.execute(this, args, "compose:s/mime"); }.execute(this, args, "compose:s/mime");
} }