Show certificate information / quick setup

This commit is contained in:
M66B
2021-08-14 09:00:49 +02:00
parent adfcc4b391
commit ce3f3dd387
7 changed files with 169 additions and 80 deletions

View File

@@ -143,6 +143,19 @@ public class EntityCertificate {
}
}
static String getKeyFingerprint(X509Certificate certificate) {
if (certificate == null)
return null;
try {
String keyId = getKeyId(certificate);
String fingerPrint = getFingerprintSha1(certificate);
return fingerPrint + (keyId == null ? "" : "/" + keyId);
} catch (Throwable ex) {
Log.e(ex);
return null;
}
}
static String getSubject(X509Certificate certificate) {
return certificate.getSubjectX500Principal().getName(X500Principal.RFC2253);
}