Encrypt with all known public keys

pull/169/head
M66B 5 years ago
parent ea1b7c0a6d
commit e9f257f982

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

Loading…
Cancel
Save