S/MIME display sign algorithm

pull/215/head
M66B 6 months ago
parent a82eba94dd
commit 05a6488572

@ -194,7 +194,11 @@ public class AdapterCertificate extends RecyclerView.Adapter<AdapterCertificate.
private void bindTo(EntityCertificate certificate) { private void bindTo(EntityCertificate certificate) {
tvEmail.setText(certificate.email); tvEmail.setText(certificate.email);
ivIntermediate.setVisibility(certificate.intermediate ? View.VISIBLE : View.INVISIBLE); 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)); tvAfter.setText(certificate.after == null ? null : TF.format(certificate.after));
tvBefore.setText(certificate.before == null ? null : TF.format(certificate.before)); tvBefore.setText(certificate.before == null ? null : TF.format(certificate.before));
tvExpired.setVisibility(certificate.isExpired() ? View.VISIBLE : View.GONE); tvExpired.setVisibility(certificate.isExpired() ? View.VISIBLE : View.GONE);

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

Loading…
Cancel
Save