|
|
|
@ -2026,13 +2026,15 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
certs.add(chain[0]); // Allow sender to decrypt own message
|
|
|
|
|
for (Address address : addresses) {
|
|
|
|
|
String email = ((InternetAddress) address).getAddress();
|
|
|
|
|
List<EntityCertificate> e = db.certificate().getCertificateByEmail(email);
|
|
|
|
|
if (e == null || e.size() < 1)
|
|
|
|
|
List<EntityCertificate> acertificates = db.certificate().getCertificateByEmail(email);
|
|
|
|
|
if (acertificates == null || acertificates.size() == 0)
|
|
|
|
|
throw new IllegalArgumentException(context.getString(R.string.title_certificate_missing, email), new IllegalStateException());
|
|
|
|
|
for (EntityCertificate acertificate : acertificates) {
|
|
|
|
|
X509Certificate cert = (X509Certificate) CertificateFactory.getInstance("X.509")
|
|
|
|
|
.generateCertificate(new ByteArrayInputStream(e.get(0).getEncoded()));
|
|
|
|
|
.generateCertificate(new ByteArrayInputStream(acertificate.getEncoded()));
|
|
|
|
|
certs.add(cert);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Build signature
|
|
|
|
|
BodyPart bpSignature = new MimeBodyPart();
|
|
|
|
|