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:
parent
a82eba94dd
commit
05a6488572
2 changed files with 13 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue