mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-26 07:53:12 +00:00
Mark trusted certificates
This commit is contained in:
parent
208ec02cd3
commit
2d12c00ba4
1 changed files with 7 additions and 2 deletions
|
@ -4825,8 +4825,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
ArrayList<String> trace = new ArrayList<>();
|
||||
for (Certificate c : path.getCertPath().getCertificates())
|
||||
if (c instanceof X509Certificate) {
|
||||
// https://tools.ietf.org/html/rfc5280#section-4.2.1.3
|
||||
boolean[] usage = ((X509Certificate) c).getKeyUsage();
|
||||
boolean root = (usage != null && usage[5]);
|
||||
EntityCertificate record = EntityCertificate.from((X509Certificate) c, null);
|
||||
trace.add(record.subject);
|
||||
trace.add(record.subject + (root ? " *" : ""));
|
||||
}
|
||||
args.putStringArrayList("trace", trace);
|
||||
} catch (Throwable ex) {
|
||||
|
@ -4834,8 +4837,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
|
||||
ArrayList<String> trace = new ArrayList<>();
|
||||
for (X509Certificate c : certs) {
|
||||
boolean[] usage = ((X509Certificate) c).getKeyUsage();
|
||||
boolean root = (usage != null && usage[5]);
|
||||
EntityCertificate record = EntityCertificate.from(c, null);
|
||||
trace.add(record.subject);
|
||||
trace.add(record.subject + (root ? " *" : ""));
|
||||
}
|
||||
args.putStringArrayList("trace", trace);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue