1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

S/MIME display sign algorithm

This commit is contained in:
M66B 2024-07-01 08:23:06 +02:00
parent a82eba94dd
commit 05a6488572
2 changed files with 13 additions and 1 deletions

View file

@ -194,7 +194,11 @@ public class AdapterCertificate extends RecyclerView.Adapter<AdapterCertificate.
private void bindTo(EntityCertificate certificate) {
tvEmail.setText(certificate.email);
ivIntermediate.setVisibility(certificate.intermediate ? View.VISIBLE : View.INVISIBLE);
tvSubject.setText(certificate.subject);
String subject = certificate.subject;
String algo = certificate.getSigAlgName();
if (algo != null)
subject = algo + " " + subject;
tvSubject.setText(subject);
tvAfter.setText(certificate.after == null ? null : TF.format(certificate.after));
tvBefore.setText(certificate.before == null ? null : TF.format(certificate.before));
tvExpired.setVisibility(certificate.isExpired() ? View.VISIBLE : View.GONE);

View file

@ -114,6 +114,14 @@ public class EntityCertificate {
.generateCertificate(new ByteArrayInputStream(encoded));
}
String getSigAlgName() {
try {
return getCertificate().getSigAlgName();
} catch (Throwable ex) {
return null;
}
}
String getPem() throws CertificateException, IOException {
StringWriter writer = new StringWriter();
JcaPEMWriter pemWriter = new JcaPEMWriter(writer);