Skip to content

Commit

Permalink
PackageManager: fixing things 3
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRare2 committed Jun 13, 2024
1 parent 2a6dc69 commit de6aefc
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions app/src/main/java/com/termux/api/apis/PackageManagerAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,10 @@ public void writeJson(JsonWriter out) throws IOException {
CertificateFactory factory = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate) factory.generateCertificate(input);
out.name("sign_algorithm").value(cert.getSigAlgName());
out.name("valid_from").value(cert.getNotBefore().getTime());
out.name("valid_to").value(cert.getNotAfter().getTime());
out.name("issuer_name").value(cert.getIssuerDN().getName());
out.name("issuer_org").value(cert.getIssuerX500Principal().getName("O"));
out.name("issuer_country").value(cert.getIssuerX500Principal().getName("C"));
out.name("subject_name").value(cert.getSubjectDN().getName());
out.name("subject_org").value(cert.getSubjectX500Principal().getName("O"));
out.name("subject_country").value(cert.getSubjectX500Principal().getName("C"));
out.name("valid_from").value(cert.getNotBefore().getTime()/1000);
out.name("valid_to").value(cert.getNotAfter().getTime()/1000);
out.name("issuer").value(cert.getIssuerDN().getName());
out.name("subject").value(cert.getSubjectDN().getName());
} catch (CertificateException e) {}
}
out.endObject();
Expand Down Expand Up @@ -244,14 +240,10 @@ public void writeJson(JsonWriter out) throws IOException {
CertificateFactory factory = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate) factory.generateCertificate(input);
out.name("sign_algorithm").value(cert.getSigAlgName());
out.name("valid_from").value(cert.getNotBefore().getTime());
out.name("valid_to").value(cert.getNotAfter().getTime());
out.name("issuer_name").value(cert.getIssuerDN().getName());
out.name("issuer_org").value(cert.getIssuerX500Principal().getName("O"));
out.name("issuer_country").value(cert.getIssuerX500Principal().getName("C"));
out.name("subject_name").value(cert.getSubjectDN().getName());
out.name("subject_org").value(cert.getSubjectX500Principal().getName("O"));
out.name("subject_country").value(cert.getSubjectX500Principal().getName("C"));
out.name("valid_from").value(cert.getNotBefore().getTime()/1000);
out.name("valid_to").value(cert.getNotAfter().getTime()/1000);
out.name("issuer").value(cert.getIssuerDN().getName());
out.name("subject").value(cert.getSubjectDN().getName());
} catch (CertificateException e) {}
}
out.endObject();
Expand Down

0 comments on commit de6aefc

Please sign in to comment.